From c7336815078ff3745e3130aeff35991e3e98e61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Majewski?= Date: Tue, 13 Nov 2012 03:21:55 +0000 Subject: pmic: Extend PMIC framework to support multiple instances of PMIC devices The PMIC framework has been extended to support multiple instances of the variety of devices responsible for power management. This change allows supporting of e.g. fuel gauge, charger, MUIC (Micro USB Interface Circuit). Power related includes have been moved to ./include/power directory. This is a first of a series of patches - in the future "pmic" will be replaced with "power". Two important issues: 1. The PMIC needs to be initialized just after malloc is configured 2. It uses list to hold information about available PMIC devices Signed-off-by: Lukasz Majewski Signed-off-by: Kyungmin Park Cc: Stefano Babic --- board/freescale/mx51evk/mx51evk.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'board/freescale/mx51evk/mx51evk.c') diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index 421d8c2..5504636 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -252,9 +252,15 @@ static void power_init(void) unsigned int val; struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE; struct pmic *p; + int ret; + + ret = pmic_init(I2C_PMIC); + if (ret) + return; - pmic_init(); - p = get_pmic(); + p = pmic_get("FSL_PMIC"); + if (!p) + return; /* Write needed to Power Gate 2 register */ pmic_reg_read(p, REG_POWER_MISC, &val); -- cgit v1.1 From 5d71bd210ff3ab5b510071cae7ed1ea51ba9e0ca Mon Sep 17 00:00:00 2001 From: Vikram Narayanan Date: Sat, 10 Nov 2012 02:28:52 +0000 Subject: mx51evk: Fix build error when CONFIG_VIDEO is disabled The inclusion of LCD patch into mx51evk breaks the build when CONFIG_VIDEO is disabled. Fix this by splitting the video related stuff to a new file. Also rename the function lcd_iomux to setup_iomux_lcd to make the namings aligned with the other iomux functions. Signed-off-by: Vikram Narayanan Signed-off-by: Anatolij Gustschin Cc: Fabio Estevam Cc: Stefano Babic --- board/freescale/mx51evk/mx51evk.c | 57 ++------------------------------------- 1 file changed, 2 insertions(+), 55 deletions(-) (limited to 'board/freescale/mx51evk/mx51evk.c') diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index 421d8c2..bc9d966 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -37,12 +38,6 @@ #include #include #include -#include -#include - -#define MX51EVK_LCD_3V3 IMX_GPIO_NR(4, 9) -#define MX51EVK_LCD_5V IMX_GPIO_NR(4, 10) -#define MX51EVK_LCD_BACKLIGHT IMX_GPIO_NR(3, 4) DECLARE_GLOBAL_DATA_PTR; @@ -471,54 +466,6 @@ int board_mmc_init(bd_t *bis) } #endif -static struct fb_videomode const claa_wvga = { - .name = "CLAA07LC0ACW", - .refresh = 57, - .xres = 800, - .yres = 480, - .pixclock = 37037, - .left_margin = 40, - .right_margin = 60, - .upper_margin = 10, - .lower_margin = 10, - .hsync_len = 20, - .vsync_len = 10, - .sync = 0, - .vmode = FB_VMODE_NONINTERLACED -}; - -void lcd_iomux(void) -{ - /* DI2_PIN15 */ - mxc_request_iomux(MX51_PIN_DI_GP4, IOMUX_CONFIG_ALT4); - - /* Pad settings for MX51_PIN_DI2_DISP_CLK */ - mxc_iomux_set_pad(MX51_PIN_DI2_DISP_CLK, PAD_CTL_HYS_NONE | - PAD_CTL_PKE_ENABLE | PAD_CTL_PUE_KEEPER | - PAD_CTL_DRV_MAX | PAD_CTL_SRE_SLOW); - - /* Turn on 3.3V voltage for LCD */ - mxc_request_iomux(MX51_PIN_CSI2_D12, IOMUX_CONFIG_ALT3); - gpio_direction_output(MX51EVK_LCD_3V3, 1); - - /* Turn on 5V voltage for LCD */ - mxc_request_iomux(MX51_PIN_CSI2_D13, IOMUX_CONFIG_ALT3); - gpio_direction_output(MX51EVK_LCD_5V, 1); - - /* Turn on GPIO backlight */ - mxc_request_iomux(MX51_PIN_DI1_D1_CS, IOMUX_CONFIG_ALT4); - mxc_iomux_set_input(MX51_GPIO3_IPP_IND_G_IN_4_SELECT_INPUT, - INPUT_CTL_PATH1); - gpio_direction_output(MX51EVK_LCD_BACKLIGHT, 1); -} - -void lcd_enable(void) -{ - int ret = ipuv3_fb_init(&claa_wvga, 1, IPU_PIX_FMT_RGB565); - if (ret) - printf("LCD cannot be configured: %d\n", ret); -} - int board_early_init_f(void) { setup_iomux_uart(); @@ -526,7 +473,7 @@ int board_early_init_f(void) #ifdef CONFIG_USB_EHCI_MX5 setup_usb_h1(); #endif - lcd_iomux(); + setup_iomux_lcd(); return 0; } -- cgit v1.1