From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: OMAP display subsystem - does it work?
Date: Fri, 20 Dec 2013 08:10:27 -0800 [thread overview]
Message-ID: <20131220161027.GA27438@atomide.com> (raw)
In-Reply-To: <20131220112700.GF32243@n2100.arm.linux.org.uk>
* Russell King - ARM Linux <linux@arm.linux.org.uk> [131220 03:28]:
>
> > BTW, I'm seeing MMC errors with my LDP here though, does that work
> > for you?
>
> I see no errors there.
OK thanks that's good to hear. I'm seeing them even after changing the
MMC card, need to check that again though. I'm almost certain it worked
just fine a month ago or so when I was playing with it.. Maybe some dirt
in the contacts or something.
> Okay, while digging through the changes, I found this - this is the old
> code. gpio + 15 is the backlight enable GPIO.
>
> static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
> {
> - ldp_panel_data.gpios[0] = gpio + 7;
> - ldp_panel_data.gpio_invert[0] = true;
>
> - ldp_panel_data.gpios[1] = gpio + 15;
> - ldp_panel_data.gpio_invert[1] = true;
>
> return 0;
> }
>
> ...
>
> -static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev)
> -{
> ...
> - for (i = 0; i < panel_data->num_gpios; ++i) {
> - gpio_set_value_cansleep(panel_data->gpios[i],
> - panel_data->gpio_invert[i] ? 0 : 1);
> - }
>
> -static void generic_dpi_panel_power_off(struct omap_dss_device *dssdev)
> -{
> ...
> - for (i = panel_data->num_gpios - 1; i >= 0; --i) {
> - gpio_set_value_cansleep(panel_data->gpios[i],
> - panel_data->gpio_invert[i] ? 1 : 0);
> - }
>
> -static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
> -{
> - for (i = 0; i < panel_data->num_gpios; ++i) {
> - r = devm_gpio_request_one(dssdev->dev, panel_data->gpios[i],
> - panel_data->gpio_invert[i] ?
> - GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW,
> - "panel gpio");
> - if (r)
> - return r;
> - }
>
> So, when gpio_invert[] is set, the signal is active low for "on". What
> does the new code do?
>
> static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
> {
> + /* LCD enable GPIO */
> + ldp_lcd_pdata.enable_gpio = gpio + 7;
>
> + /* Backlight enable GPIO */
> + ldp_lcd_pdata.backlight_gpio = gpio + 15;
> ...
>
> static int panel_dpi_enable(struct omap_dss_device *dssdev)
> {
> ...
> if (gpio_is_valid(ddata->backlight_gpio))
> gpio_set_value_cansleep(ddata->backlight_gpio, 1);
>
> ...
> static void panel_dpi_disable(struct omap_dss_device *dssdev)
> {
> ...
> if (gpio_is_valid(ddata->backlight_gpio))
> gpio_set_value_cansleep(ddata->backlight_gpio, 0);
>
> ...
> static int panel_dpi_probe(struct platform_device *pdev)
> {
> ...
> if (gpio_is_valid(ddata->backlight_gpio)) {
> r = devm_gpio_request_one(&pdev->dev, ddata->backlight_gpio,
> GPIOF_OUT_INIT_LOW, "panel backlight");
>
> which is fixed at active-high for "on".
>
> Would you like to revise whether this works for you... I suspect that
> you're missing configuration which means that the backlight_gpio is
> not valid, and hence it's being left in same default state (maybe by
> the boot loader?)
Nope, my LCD if off from the bootloader and gets enabled by the kernel.
I think the old gpio_invert was inverting the value unnecessarily or
something, the new code does the right thing without a need for the
gpio_invert flags.
Regards,
Tony
next prev parent reply other threads:[~2013-12-20 16:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 12:00 OMAP display subsystem - does it work? Russell King - ARM Linux
2013-12-18 13:54 ` Tomi Valkeinen
2013-12-18 15:29 ` Russell King - ARM Linux
2013-12-18 16:03 ` Tomi Valkeinen
2013-12-18 18:23 ` Tony Lindgren
2013-12-19 5:23 ` Tomi Valkeinen
2013-12-19 16:56 ` Tony Lindgren
2013-12-20 7:45 ` Tomi Valkeinen
2013-12-19 17:56 ` Russell King - ARM Linux
2013-12-19 18:22 ` Tony Lindgren
2013-12-20 11:27 ` Russell King - ARM Linux
2013-12-20 11:48 ` Russell King - ARM Linux
2013-12-20 13:43 ` Tomi Valkeinen
2013-12-20 16:04 ` Tony Lindgren
2013-12-20 16:55 ` Tony Lindgren
2013-12-21 0:59 ` Russell King - ARM Linux
2013-12-28 23:30 ` Russell King - ARM Linux
2013-12-23 7:53 ` Tomi Valkeinen
2013-12-27 18:11 ` Tony Lindgren
2013-12-23 7:49 ` Tomi Valkeinen
2013-12-20 16:10 ` Tony Lindgren [this message]
2013-12-19 17:53 ` Russell King - ARM Linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131220161027.GA27438@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).