From patchwork Tue Apr 22 21:12:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Belisko X-Patchwork-Id: 4035801 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0EFADBFF02 for ; Tue, 22 Apr 2014 21:15:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14927201EF for ; Tue, 22 Apr 2014 21:15:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23C4D2025B for ; Tue, 22 Apr 2014 21:15:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758633AbaDVVPA (ORCPT ); Tue, 22 Apr 2014 17:15:00 -0400 Received: from mail-ee0-f48.google.com ([74.125.83.48]:46282 "EHLO mail-ee0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757826AbaDVVNK (ORCPT ); Tue, 22 Apr 2014 17:13:10 -0400 Received: by mail-ee0-f48.google.com with SMTP id b57so125352eek.7 for ; Tue, 22 Apr 2014 14:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=RFAyYihzV2rc/JCp4DZX6Hl/LMCfkSlLktI+ip2uAIY=; b=tFuwadGIqoNaDjuAU1FL7JyxLPd/fmBC4qvudSDiVQ5OLW20tHYHTyMulfX4i6mMsp 0YhUXu4YalAEzZTIasD1VkLpFnhO1otvSG1THKuizf+DYGDwauhgx21MOP60WuaYS4yn 0XNjodxIJSBnPTPyeE+ShstYjMkb8Bm1hfYpEEWHEUJwkoc3ZKDNlY0TFX3a9CGuDz55 d6/UKQ5FDnmgZM+s2uQbS53yBPjvmMrb2jC+IFC95pCtY+M/idlZPhi5/20RSOaEw+fK 8HD2plbHaYavW+9tksFTqU3EdQbw6d2RaveFqcFRudze3ewCi+WtgeQjnZz2v6u1mU7w 5c7A== X-Received: by 10.14.206.137 with SMTP id l9mr58996672eeo.40.1398201189060; Tue, 22 Apr 2014 14:13:09 -0700 (PDT) Received: from localhost.localdomain (ip-85.163.40.255.o2inet.sk. [85.163.40.255]) by mx.google.com with ESMTPSA id q41sm103364eez.7.2014.04.22.14.13.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 14:13:08 -0700 (PDT) From: Marek Belisko To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, rdunlap@infradead.org, bcousson@baylibre.com, tony@atomide.com, linux@arm.linux.org.uk, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com, grant.likely@linaro.org Cc: devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, hns@goldelico.com, Marek Belisko Subject: [PATCH 1/2] omapdss: panel-tpo-td028ec1: Add DT support. Date: Tue, 22 Apr 2014 23:12:47 +0200 Message-Id: <1398201168-25275-2-git-send-email-marek@goldelico.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398201168-25275-1-git-send-email-marek@goldelico.com> References: <1398201168-25275-1-git-send-email-marek@goldelico.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Marek Belisko --- .../bindings/video/toppoly,td028ttec1.txt | 30 ++++++++++++++++++++ .../omap2/displays-new/panel-tpo-td028ttec1.c | 32 +++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/video/toppoly,td028ttec1.txt diff --git a/Documentation/devicetree/bindings/video/toppoly,td028ttec1.txt b/Documentation/devicetree/bindings/video/toppoly,td028ttec1.txt new file mode 100644 index 0000000..7175dc3 --- /dev/null +++ b/Documentation/devicetree/bindings/video/toppoly,td028ttec1.txt @@ -0,0 +1,30 @@ +Toppoly TD028TTEC1 Panel +======================== + +Required properties: +- compatible: "toppoly,td028ttec1" + +Optional properties: +- label: a symbolic name for the panel + +Required nodes: +- Video port for DPI input + +Example +------- + +lcd-panel: td028ttec1@0 { + compatible = "toppoly,td028ttec1"; + reg = <0>; + spi-max-frequency = <100000>; + spi-cpol; + spi-cpha; + + label = "lcd"; + port { + lcd_in: endpoint { + remote-endpoint = <&dpi_out>; + }; + }; +}; + diff --git a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c b/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c index fae6adc..70a56ff 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c @@ -206,7 +206,8 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev) if (omapdss_device_is_enabled(dssdev)) return 0; - in->ops.dpi->set_data_lines(in, ddata->data_lines); + if (ddata->data_lines) + in->ops.dpi->set_data_lines(in, ddata->data_lines); in->ops.dpi->set_timings(in, &ddata->videomode); r = in->ops.dpi->enable(in); @@ -389,6 +390,23 @@ static int td028ttec1_panel_probe_pdata(struct spi_device *spi) return 0; } +static int td028ttec1_probe_of(struct spi_device *spi) +{ + struct device_node *node = spi->dev.of_node; + struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev); + struct omap_dss_device *in; + + in = omapdss_of_find_source_for_first_ep(node); + if (IS_ERR(in)) { + dev_err(&spi->dev, "failed to find video source\n"); + return PTR_ERR(in); + } + + ddata->in = in; + + return 0; +} + static int td028ttec1_panel_probe(struct spi_device *spi) { struct panel_drv_data *ddata; @@ -418,6 +436,10 @@ static int td028ttec1_panel_probe(struct spi_device *spi) r = td028ttec1_panel_probe_pdata(spi); if (r) return r; + } else if (spi->dev.of_node) { + r = td028ttec1_probe_of(spi); + if (r) + return r; } else { return -ENODEV; } @@ -463,6 +485,13 @@ static int td028ttec1_panel_remove(struct spi_device *spi) return 0; } +static const struct of_device_id td028ttec1_of_match[] = { + { .compatible = "toppoly,td028ttec1", }, + {}, +}; + +MODULE_DEVICE_TABLE(of, td028ttec1_of_match); + static struct spi_driver td028ttec1_spi_driver = { .probe = td028ttec1_panel_probe, .remove = td028ttec1_panel_remove, @@ -470,6 +499,7 @@ static struct spi_driver td028ttec1_spi_driver = { .driver = { .name = "panel-tpo-td028ttec1", .owner = THIS_MODULE, + .of_match_table = td028ttec1_of_match, }, };