From patchwork Thu May 12 07:16:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Grinberg X-Patchwork-Id: 779292 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4C7GTXK029665 for ; Thu, 12 May 2011 07:16:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752022Ab1ELHQO (ORCPT ); Thu, 12 May 2011 03:16:14 -0400 Received: from 50.23.254.54-static.reverse.softlayer.com ([50.23.254.54]:43322 "EHLO softlayer.compulab.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750846Ab1ELHQL (ORCPT ); Thu, 12 May 2011 03:16:11 -0400 Received: from [62.90.235.247] (port=40126 helo=zimbra-mta.compulab.co.il) by softlayer.compulab.co.il with esmtp (Exim 4.69) (envelope-from ) id 1QKQ80-0006Gc-Mv; Thu, 12 May 2011 10:16:09 +0300 Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id C67257E99BC; Thu, 12 May 2011 10:16:07 +0300 (IDT) X-Virus-Scanned: amavisd-new at compulab.co.il Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id auH0hyS+Mr4S; Thu, 12 May 2011 10:16:07 +0300 (IDT) Received: from [10.1.1.13] (grinberg-pc.compulab.local [10.1.1.13]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id D58A67E99BB; Thu, 12 May 2011 10:16:06 +0300 (IDT) Message-ID: <4DCB8937.2060101@compulab.co.il> Date: Thu, 12 May 2011 10:16:07 +0300 From: Igor Grinberg Organization: CompuLab Ltd. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.2.13) Gecko/20101211 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Tomi Valkeinen CC: "Janorkar, Mayuresh" , "tony@atomide.com" , "linux-omap@vger.kernel.org" , Stanley Miao Subject: Re: [PATCH 4/6] OMAP: LDP: Port the display driver to new DSS2 References: <1304926567-26814-1-git-send-email-tomi.valkeinen@ti.com> <1304926567-26814-5-git-send-email-tomi.valkeinen@ti.com> <1305095563.2097.11.camel@deskari> <4DCB80DD.5090408@compulab.co.il> In-Reply-To: <4DCB80DD.5090408@compulab.co.il> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - softlayer.compulab.co.il X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 12 May 2011 07:16:31 +0000 (UTC) On 05/12/11 09:40, Igor Grinberg wrote: > On 05/11/11 09:32, Tomi Valkeinen wrote: >> On Wed, 2011-05-11 at 10:28 +0530, Janorkar, Mayuresh wrote: >>>> +static void __init ldp_display_init(void) >>>> +{ >>>> + int r; >>>> + >>>> + struct gpio gpios[] = { >>>> + {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"}, >>>> + {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"}, >>>> + {LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD ENABLE"}, >>>> + {LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD >>>> BACKLIGHT"}, >>>> + }; >>>> + >>>> + r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); >>>> + if (r) { >>>> + pr_err("Cannot request LCD GPIOs, error %d\n", r); >>>> + return; >>>> + } >>> If I test with this patch, this request is returning error. >> Hmm. Well, the GPIOs are the same as in the old driver. However, the old >> driver doesn't even seem to check if it manages to request the GPIOs, so >> it may well be that it was failing also. >> >> Can you check from /sys/class/gpio/ if some of the GPIOs are already >> allocated: 207, 199, 55, 56? >> >> The definition of two of those GPIOs look kinda funny to me: (15 + >> OMAP_MAX_GPIO_LINES). I don't know what OMAP_MAX_GPIO_LINES means, but >> it sure doesn't sound ok to have a GPIO number that is 15 over the >> maximum =). >> > This means that some kind of gpio expander is used. > I bet those are twl gpios (or may be some other discrete chip). > If those are twl gpios then you need to provide the .setup callback > in struct twl4030_gpio_platform_data which will request and setup those gpios. > No need to wonder ;) Mayuresh, try the attached patch (though some changes to Tomi's patch will be needed) if it works, then we're good. Tomi, Your "ldp" patch does not apply, it would be nice if you rebase on top of Tony's master. arch/arm/mach-omap2/board-ldp.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index f7d6038..ca92e43 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -203,10 +203,27 @@ static struct twl4030_usb_data ldp_usb_data = { .usb_mode = T2_USB_MODE_ULPI, }; +static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) +{ + int r; + + struct gpio twl_gpios[] = { + {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"}, + {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"}, + }; + + r = gpio_request_array(twl_gpios, ARRAY_SIZE(gpios)); + if (r) + pr_err("Cannot request LCD GPIOs, error %d\n", r); + + return r; +} + static struct twl4030_gpio_platform_data ldp_gpio_data = { .gpio_base = OMAP_MAX_GPIO_LINES, .irq_base = TWL4030_GPIO_IRQ_BASE, .irq_end = TWL4030_GPIO_IRQ_END, + .setup = ldp_twl_gpios_setup, }; static struct twl4030_madc_platform_data ldp_madc_data = {