* [U-Boot] [PATCH] board: ge: bx50v3: Use pwm for display backlight @ 2016-03-15 18:24 Akshay Bhat 2016-04-06 14:39 ` Akshay Bhat 0 siblings, 1 reply; 3+ messages in thread From: Akshay Bhat @ 2016-03-15 18:24 UTC (permalink / raw) To: u-boot Setup the LCD backlight brightness control pin to use PWM Signed-off-by: Akshay Bhat <akshay.bhat@timesys.com> Cc: Stefano Babic <sbabic@denx.de> --- board/ge/bx50v3/bx50v3.c | 11 +++++++++++ include/configs/ge_bx50v3.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index cf2cd1a..8e55acf 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -25,6 +25,7 @@ #include <asm/io.h> #include <asm/arch/sys_proto.h> #include <i2c.h> +#include <pwm.h> DECLARE_GLOBAL_DATA_PTR; #define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ @@ -324,6 +325,8 @@ static iomux_v3_cfg_t const backlight_pads[] = { /* Backlight enable for LVDS display */ MX6_PAD_GPIO_0__GPIO1_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL), #define LVDS_BACKLIGHT_GP IMX_GPIO_NR(1, 0) + /* backlight PWM brightness control */ + MX6_PAD_SD1_DAT3__PWM1_OUT | MUX_PAD_CTRL(NO_PAD_CTRL), }; static void do_enable_hdmi(struct display_info_t const *dev) @@ -676,9 +679,17 @@ int board_late_init(void) * as per specifications from CHI MEI */ mdelay(250); + /* enable backlight PWM 1 */ + pwm_init(0, 0, 0); + + /* duty cycle 5000000ns, period: 5000000ns */ + pwm_config(0, 5000000, 5000000); + /* Backlight Power */ gpio_direction_output(LVDS_BACKLIGHT_GP, 1); + pwm_enable(0); + return 0; } diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index 6fa4a9a..e37cd33 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -327,6 +327,9 @@ #define CONFIG_IMX_HDMI #define CONFIG_IMX_VIDEO_SKIP +#define CONFIG_PWM_IMX +#define CONFIG_IMX6_PWM_PER_CLK 66000000 + #undef CONFIG_CMD_PCI #ifdef CONFIG_CMD_PCI #define CONFIG_PCI -- 2.7.3 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] board: ge: bx50v3: Use pwm for display backlight 2016-03-15 18:24 [U-Boot] [PATCH] board: ge: bx50v3: Use pwm for display backlight Akshay Bhat @ 2016-04-06 14:39 ` Akshay Bhat 2016-04-06 15:05 ` Stefano Babic 0 siblings, 1 reply; 3+ messages in thread From: Akshay Bhat @ 2016-04-06 14:39 UTC (permalink / raw) To: u-boot On Tue, Mar 15, 2016 at 2:24 PM, Akshay Bhat <akshay.bhat@timesys.com> wrote: > Setup the LCD backlight brightness control pin to use PWM > > Signed-off-by: Akshay Bhat <akshay.bhat@timesys.com> > Cc: Stefano Babic <sbabic@denx.de> > --- > Hi Stefano, Can this be applied if there are no review comments? Thanks, Akshay > board/ge/bx50v3/bx50v3.c | 11 +++++++++++ > include/configs/ge_bx50v3.h | 3 +++ > 2 files changed, 14 insertions(+) > > diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c > index cf2cd1a..8e55acf 100644 > --- a/board/ge/bx50v3/bx50v3.c > +++ b/board/ge/bx50v3/bx50v3.c > @@ -25,6 +25,7 @@ > #include <asm/io.h> > #include <asm/arch/sys_proto.h> > #include <i2c.h> > +#include <pwm.h> > DECLARE_GLOBAL_DATA_PTR; > > #define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ > @@ -324,6 +325,8 @@ static iomux_v3_cfg_t const backlight_pads[] = { > /* Backlight enable for LVDS display */ > MX6_PAD_GPIO_0__GPIO1_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL), > #define LVDS_BACKLIGHT_GP IMX_GPIO_NR(1, 0) > + /* backlight PWM brightness control */ > + MX6_PAD_SD1_DAT3__PWM1_OUT | MUX_PAD_CTRL(NO_PAD_CTRL), > }; > > static void do_enable_hdmi(struct display_info_t const *dev) > @@ -676,9 +679,17 @@ int board_late_init(void) > * as per specifications from CHI MEI */ > mdelay(250); > > + /* enable backlight PWM 1 */ > + pwm_init(0, 0, 0); > + > + /* duty cycle 5000000ns, period: 5000000ns */ > + pwm_config(0, 5000000, 5000000); > + > /* Backlight Power */ > gpio_direction_output(LVDS_BACKLIGHT_GP, 1); > > + pwm_enable(0); > + > return 0; > } > > diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h > index 6fa4a9a..e37cd33 100644 > --- a/include/configs/ge_bx50v3.h > +++ b/include/configs/ge_bx50v3.h > @@ -327,6 +327,9 @@ > #define CONFIG_IMX_HDMI > #define CONFIG_IMX_VIDEO_SKIP > > +#define CONFIG_PWM_IMX > +#define CONFIG_IMX6_PWM_PER_CLK 66000000 > + > #undef CONFIG_CMD_PCI > #ifdef CONFIG_CMD_PCI > #define CONFIG_PCI > -- > 2.7.3 > > ^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] board: ge: bx50v3: Use pwm for display backlight 2016-04-06 14:39 ` Akshay Bhat @ 2016-04-06 15:05 ` Stefano Babic 0 siblings, 0 replies; 3+ messages in thread From: Stefano Babic @ 2016-04-06 15:05 UTC (permalink / raw) To: u-boot Hi Akshay, On 06/04/2016 16:39, Akshay Bhat wrote: > > On Tue, Mar 15, 2016 at 2:24 PM, Akshay Bhat <akshay.bhat@timesys.com > <mailto:akshay.bhat@timesys.com>> wrote: > > Setup the LCD backlight brightness control pin to use PWM > > Signed-off-by: Akshay Bhat <akshay.bhat@timesys.com > <mailto:akshay.bhat@timesys.com>> > Cc: Stefano Babic <sbabic at denx.de <mailto:sbabic@denx.de>> > --- > > > Hi Stefano, > > Can this be applied if there are no review comments? > This is straightforward and can be applied - but I am afraid you need this just if "Update display setup" is applied. I have some minor changes to ask for that, I am sending my review. Best regards, Stefano > Thanks, > Akshay > > > board/ge/bx50v3/bx50v3.c | 11 +++++++++++ > include/configs/ge_bx50v3.h | 3 +++ > 2 files changed, 14 insertions(+) > > diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c > index cf2cd1a..8e55acf 100644 > --- a/board/ge/bx50v3/bx50v3.c > +++ b/board/ge/bx50v3/bx50v3.c > @@ -25,6 +25,7 @@ > #include <asm/io.h> > #include <asm/arch/sys_proto.h> > #include <i2c.h> > +#include <pwm.h> > DECLARE_GLOBAL_DATA_PTR; > > #define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ > @@ -324,6 +325,8 @@ static iomux_v3_cfg_t const backlight_pads[] = { > /* Backlight enable for LVDS display */ > MX6_PAD_GPIO_0__GPIO1_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL), > #define LVDS_BACKLIGHT_GP IMX_GPIO_NR(1, 0) > + /* backlight PWM brightness control */ > + MX6_PAD_SD1_DAT3__PWM1_OUT | MUX_PAD_CTRL(NO_PAD_CTRL), > }; > > static void do_enable_hdmi(struct display_info_t const *dev) > @@ -676,9 +679,17 @@ int board_late_init(void) > * as per specifications from CHI MEI */ > mdelay(250); > > + /* enable backlight PWM 1 */ > + pwm_init(0, 0, 0); > + > + /* duty cycle 5000000ns, period: 5000000ns */ > + pwm_config(0, 5000000, 5000000); > + > /* Backlight Power */ > gpio_direction_output(LVDS_BACKLIGHT_GP, 1); > > + pwm_enable(0); > + > return 0; > } > > diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h > index 6fa4a9a..e37cd33 100644 > --- a/include/configs/ge_bx50v3.h > +++ b/include/configs/ge_bx50v3.h > @@ -327,6 +327,9 @@ > #define CONFIG_IMX_HDMI > #define CONFIG_IMX_VIDEO_SKIP > > +#define CONFIG_PWM_IMX > +#define CONFIG_IMX6_PWM_PER_CLK 66000000 > + > #undef CONFIG_CMD_PCI > #ifdef CONFIG_CMD_PCI > #define CONFIG_PCI > -- > 2.7.3 > > -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-06 15:05 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-15 18:24 [U-Boot] [PATCH] board: ge: bx50v3: Use pwm for display backlight Akshay Bhat 2016-04-06 14:39 ` Akshay Bhat 2016-04-06 15:05 ` Stefano Babic
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox