diff mbox

[U-Boot,V2,4/8] video: parade: configure SLP and RST GPIOs if specified in DT

Message ID 1425391409-25576-5-git-send-email-ajaykumar.rs@samsung.com
State Superseded
Headers show

Commit Message

Ajay Kumar March 3, 2015, 2:03 p.m. UTC
Add support to configure EDP_RST GPIO and EDP_SLP GPIO,
if provided in parade DT node.

Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
 drivers/video/parade.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Simon Glass March 3, 2015, 3:04 p.m. UTC | #1
Hi,

On 3 March 2015 at 07:03, Ajay Kumar <ajaykumar.rs@samsung.com> wrote:
> Add support to configure EDP_RST GPIO and EDP_SLP GPIO,
> if provided in parade DT node.
>
> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
> ---
>  drivers/video/parade.c |   15 +++++++++++++++
>  1 file changed, 15 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
(but see below)

Tested on Pi.

Tested-by: Simon Glass <sjg@chromium.org>

>
> diff --git a/drivers/video/parade.c b/drivers/video/parade.c
> index 0f543f6..525ef07 100644
> --- a/drivers/video/parade.c
> +++ b/drivers/video/parade.c
> @@ -12,6 +12,7 @@
>  #include <common.h>
>  #include <i2c.h>
>  #include <fdtdec.h>
> +#include <asm/gpio.h>
>
>  /*
>   * Initialization of the chip is a process of writing certaing values into
> @@ -180,6 +181,8 @@ static int parade_write_regs(int base_addr, const struct reg_data *table)
>
>  int parade_init(const void *blob)
>  {
> +       struct gpio_desc rst_gpio;
> +       struct gpio_desc slp_gpio;
>         int bus, old_bus;
>         int parent;
>         int node;
> @@ -201,6 +204,18 @@ int parade_init(const void *blob)
>                 return -1;
>         }
>
> +       gpio_request_by_name_nodev(blob, node, "sleep-gpio", 0, &slp_gpio,
> +                                  GPIOD_IS_OUT);
> +       if (dm_gpio_is_valid(&slp_gpio))
> +               dm_gpio_set_value(&slp_gpio, 1);

Again you can use GPIOD_IS_OUT_ACTIVE here.

> +
> +       mdelay(10);
> +
> +       gpio_request_by_name_nodev(blob, node, "reset-gpio", 0, &rst_gpio,
> +                                  GPIOD_IS_OUT);
> +       if (dm_gpio_is_valid(&rst_gpio))
> +               dm_gpio_set_value(&rst_gpio, 1);
> +
>         bus = i2c_get_bus_num_fdt(parent);
>         old_bus = i2c_get_bus_num();
>
> --
> 1.7.9.5
>

Regards,
Simon
diff mbox

Patch

diff --git a/drivers/video/parade.c b/drivers/video/parade.c
index 0f543f6..525ef07 100644
--- a/drivers/video/parade.c
+++ b/drivers/video/parade.c
@@ -12,6 +12,7 @@ 
 #include <common.h>
 #include <i2c.h>
 #include <fdtdec.h>
+#include <asm/gpio.h>
 
 /*
  * Initialization of the chip is a process of writing certaing values into
@@ -180,6 +181,8 @@  static int parade_write_regs(int base_addr, const struct reg_data *table)
 
 int parade_init(const void *blob)
 {
+	struct gpio_desc rst_gpio;
+	struct gpio_desc slp_gpio;
 	int bus, old_bus;
 	int parent;
 	int node;
@@ -201,6 +204,18 @@  int parade_init(const void *blob)
 		return -1;
 	}
 
+	gpio_request_by_name_nodev(blob, node, "sleep-gpio", 0, &slp_gpio,
+				   GPIOD_IS_OUT);
+	if (dm_gpio_is_valid(&slp_gpio))
+		dm_gpio_set_value(&slp_gpio, 1);
+
+	mdelay(10);
+
+	gpio_request_by_name_nodev(blob, node, "reset-gpio", 0, &rst_gpio,
+				   GPIOD_IS_OUT);
+	if (dm_gpio_is_valid(&rst_gpio))
+		dm_gpio_set_value(&rst_gpio, 1);
+
 	bus = i2c_get_bus_num_fdt(parent);
 	old_bus = i2c_get_bus_num();