From: Jingoo Han <jg1.han@samsung.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCHv2 2/3] video: hx8357: Make IM pins optional
Date: Thu, 25 Jul 2013 23:47:36 +0000 [thread overview]
Message-ID: <002201ce8991$5785e8e0$0691baa0$@samsung.com> (raw)
In-Reply-To: <1374757513-2253-3-git-send-email-maxime.ripard@free-electrons.com>
On Thursday, July 25, 2013 10:05 PM, Maxime Ripard wrote:
>
> The IM pins of the HX8357 controller are used to define the interface
> used to feed pixel stream to the LCD panel.
>
> Most of the time, these pins are directly routed to either the ground or
> the VCC to set their values.
>
> Remove the need to assign GPIOs to these pins when we are in such a case.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
> drivers/video/backlight/hx8357.c | 53 +++++++++++++++++++++++-----------------
> 1 file changed, 31 insertions(+), 22 deletions(-)
>
[.....]
> + if (of_find_property(spi->dev.of_node, "im-gpios", NULL)) {
> + lcd->use_im_pins = 1;
> +
> + for (i = 0; i < HX8357_NUM_IM_PINS; i++) {
> + lcd->im_pins[i] = of_get_named_gpio(spi->dev.of_node,
> + "im-gpios", i);
> + if (lcd->im_pins[i] = -EPROBE_DEFER) {
> + dev_info(&spi->dev, "GPIO requested is not here yet, deferring the
> probe\n");
> + return -EPROBE_DEFER;
> + }
> + if (!gpio_is_valid(lcd->im_pins[i])) {
> + dev_err(&spi->dev, "Missing dt property: im-gpios\n");
> + return -EINVAL;
> + }
> +
> + ret = devm_gpio_request_one(&spi->dev, lcd->im_pins[i],
> + GPIOF_OUT_INIT_LOW,
> + "im_pins");
> + if (ret) {
> + dev_err(&spi->dev, "failed to request gpio %d: %d\n",
> + lcd->im_pins[i], ret);
> + return -EINVAL;
> + }
> }
> -
> - ret = devm_gpio_request_one(&spi->dev, lcd->im_pins[i],
> - GPIOF_OUT_INIT_LOW, "im_pins");
> - if (ret) {
> - dev_err(&spi->dev, "failed to request gpio %d: %d\n",
> - lcd->im_pins[i], ret);
> - return -EINVAL;
> - }
> - }
> + } else
> + lcd->use_im_pins = 0;
According to the 'Documentation/CodingStyle', braces are necessary as below.
} else {
lcd->use_im_pins = 0;
}
Others look good.
Acked-by: Jingoo Han <jg1.han@samsung.com>
Best regards,
Jingoo Han
next prev parent reply other threads:[~2013-07-25 23:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 13:05 [PATCHv2 0/3] Few ignored framebuffer fixes/additions Maxime Ripard
2013-07-25 13:05 ` [PATCHv2 1/3] video: mxsfb: fix color settings for 18bit data bus and 32bpp Maxime Ripard
2013-07-25 13:05 ` [PATCHv2 2/3] video: hx8357: Make IM pins optional Maxime Ripard
2013-07-25 23:47 ` Jingoo Han [this message]
2013-07-25 13:05 ` [PATCHv2 3/3] fb: backlight: HX8357: Add HX8369 support Maxime Ripard
2013-07-25 23:52 ` Jingoo Han
2013-07-31 18:14 ` Alexandre Belloni
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='002201ce8991$5785e8e0$0691baa0$@samsung.com' \
--to=jg1.han@samsung.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