RE: [PATCH 2/3] arm: s5pv210: Aquila: add support for MAX8998 PMIC
Hello, On Wednesday, July 14, 2010 6:57 AM Kukjin Kim wrote: Marek Szyprowski wrote: This patch adds required platform definitions for MAX8998 PMIC driver. Power regulators for LDO and BUCK outputs has been defined as well as a simple gpio-keys button for power key (to enable wakeup functionality with external interrupt). Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- arch/arm/mach-s5pv210/mach-aquila.c | 326 +++ 1 files changed, 326 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach- aquila.c index 44db0fc..ad0ee96 100644 --- a/arch/arm/mach-s5pv210/mach-aquila.c +++ b/arch/arm/mach-s5pv210/mach-aquila.c @@ -13,6 +13,11 @@ #include linux/init.h #include linux/serial_core.h #include linux/fb.h +#include linux/i2c.h +#include linux/i2c-gpio.h +#include linux/mfd/max8998.h +#include linux/gpio_keys.h +#include linux/input.h #include asm/mach/arch.h #include asm/mach/map.h @@ -22,7 +27,9 @@ #include mach/map.h #include mach/regs-clock.h #include mach/regs-fb.h +#include mach/gpio.h It's linux/gpio.h Ok. +#include plat/gpio-cfg.h #include plat/regs-serial.h #include plat/s5pv210.h #include plat/devs.h @@ -122,7 +129,321 @@ static struct s3c_fb_platdata aquila_lcd_pdata __initdata = { .setup_gpio = s5pv210_fb_gpio_setup_24bpp, }; +/* MAX8998 regulators */ +#if defined(CONFIG_REGULATOR_MAX8998) || \ + defined(CONFIG_REGULATOR_MAX8998_MODULE) + +static struct regulator_init_data aquila_ldo2_data = { + .constraints= { + .name = VALIVE_1.1V, + .min_uV = 110, + .max_uV = 110, + .apply_uV = 1, + .always_on = 1, + .state_mem = { + .enabled = 1, + }, + }, +}; + +static struct regulator_init_data aquila_ldo3_data = { + .constraints= { + .name = VUSB/MIPI_1.1V, + .min_uV = 110, + .max_uV = 110, + .apply_uV = 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo4_data = { + .constraints= { + .name = VDAC_3.3V, + .min_uV = 330, + .max_uV = 330, + .apply_uV = 1, + }, +}; + +static struct regulator_init_data aquila_ldo5_data = { + .constraints= { + .name = VTF_2.8V, + .min_uV = 280, + .max_uV = 280, + .apply_uV = 1, + }, +}; + +static struct regulator_init_data aquila_ldo6_data = { + .constraints= { + .name = VCC_3.3V, + .min_uV = 330, + .max_uV = 330, + .apply_uV = 1, + }, +}; + +static struct regulator_init_data aquila_ldo7_data = { + .constraints= { + .name = VCC_3.0V, + .min_uV = 300, + .max_uV = 300, + .apply_uV = 1, + .boot_on= 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo8_data = { + .constraints= { + .name = VUSB/VADC_3.3V, + .min_uV = 330, + .max_uV = 330, + .apply_uV = 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo9_data = { + .constraints= { + .name = VCC/VCAM_2.8V, + .min_uV = 280, + .max_uV = 280, + .apply_uV = 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo10_data = { + .constraints= { + .name = VPLL_1.1V, + .min_uV = 110, + .max_uV = 110, + .apply_uV = 1, + .boot_on= 1, + }, +}; + +static struct regulator_init_data aquila_ldo11_data = { + .constraints= { + .name = CAM_IO_2.8V, + .min_uV = 280, + .max_uV = 280, + .apply_uV = 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo12_data = { + .constraints= { + .name = CAM_ISP_1.2V, + .min_uV = 120, + .max_uV = 120, + .apply_uV = 1, + .always_on = 1, + }, +}; + +static struct
Re: [PATCH 2/3] ARM: S5PV210: Aquila: add support for MAX8998 PMIC
On Wed, Jul 14, 2010 at 10:16:55AM +0200, Marek Szyprowski wrote: This patch adds required platform definitions for MAX8998 PMIC driver. Power regulators for LDO and BUCK outputs has been defined as well as a simple gpio-keys button for power key (to enable wakeup functionality with external interrupt). Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com For the regulator API usage: Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 2/3] ARM: S5PV210: Aquila: add support for MAX8998 PMIC
Marek Szyprowski wrote: This patch adds required platform definitions for MAX8998 PMIC driver. Power regulators for LDO and BUCK outputs has been defined as well as a simple gpio-keys button for power key (to enable wakeup functionality with external interrupt). Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- Ok..will apply :-) Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 2/3] ARM: S5PV210: Aquila: add support for MAX8998 PMIC
Mark Brown wrote: On Wed, Jul 14, 2010 at 10:16:55AM +0200, Marek Szyprowski wrote: This patch adds required platform definitions for MAX8998 PMIC driver. Power regulators for LDO and BUCK outputs has been defined as well as a simple gpio-keys button for power key (to enable wakeup functionality with external interrupt). Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com For the regulator API usage: Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com Thanks for your ack. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 2/3] arm: s5pv210: Aquila: add support for MAX8998 PMIC
Marek Szyprowski wrote: This patch adds required platform definitions for MAX8998 PMIC driver. Power regulators for LDO and BUCK outputs has been defined as well as a simple gpio-keys button for power key (to enable wakeup functionality with external interrupt). Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- arch/arm/mach-s5pv210/mach-aquila.c | 326 +++ 1 files changed, 326 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach- aquila.c index 44db0fc..ad0ee96 100644 --- a/arch/arm/mach-s5pv210/mach-aquila.c +++ b/arch/arm/mach-s5pv210/mach-aquila.c @@ -13,6 +13,11 @@ #include linux/init.h #include linux/serial_core.h #include linux/fb.h +#include linux/i2c.h +#include linux/i2c-gpio.h +#include linux/mfd/max8998.h +#include linux/gpio_keys.h +#include linux/input.h #include asm/mach/arch.h #include asm/mach/map.h @@ -22,7 +27,9 @@ #include mach/map.h #include mach/regs-clock.h #include mach/regs-fb.h +#include mach/gpio.h It's linux/gpio.h +#include plat/gpio-cfg.h #include plat/regs-serial.h #include plat/s5pv210.h #include plat/devs.h @@ -122,7 +129,321 @@ static struct s3c_fb_platdata aquila_lcd_pdata __initdata = { .setup_gpio = s5pv210_fb_gpio_setup_24bpp, }; +/* MAX8998 regulators */ +#if defined(CONFIG_REGULATOR_MAX8998) || \ + defined(CONFIG_REGULATOR_MAX8998_MODULE) + +static struct regulator_init_data aquila_ldo2_data = { + .constraints= { + .name = VALIVE_1.1V, + .min_uV = 110, + .max_uV = 110, + .apply_uV = 1, + .always_on = 1, + .state_mem = { + .enabled = 1, + }, + }, +}; + +static struct regulator_init_data aquila_ldo3_data = { + .constraints= { + .name = VUSB/MIPI_1.1V, + .min_uV = 110, + .max_uV = 110, + .apply_uV = 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo4_data = { + .constraints= { + .name = VDAC_3.3V, + .min_uV = 330, + .max_uV = 330, + .apply_uV = 1, + }, +}; + +static struct regulator_init_data aquila_ldo5_data = { + .constraints= { + .name = VTF_2.8V, + .min_uV = 280, + .max_uV = 280, + .apply_uV = 1, + }, +}; + +static struct regulator_init_data aquila_ldo6_data = { + .constraints= { + .name = VCC_3.3V, + .min_uV = 330, + .max_uV = 330, + .apply_uV = 1, + }, +}; + +static struct regulator_init_data aquila_ldo7_data = { + .constraints= { + .name = VCC_3.0V, + .min_uV = 300, + .max_uV = 300, + .apply_uV = 1, + .boot_on= 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo8_data = { + .constraints= { + .name = VUSB/VADC_3.3V, + .min_uV = 330, + .max_uV = 330, + .apply_uV = 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo9_data = { + .constraints= { + .name = VCC/VCAM_2.8V, + .min_uV = 280, + .max_uV = 280, + .apply_uV = 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo10_data = { + .constraints= { + .name = VPLL_1.1V, + .min_uV = 110, + .max_uV = 110, + .apply_uV = 1, + .boot_on= 1, + }, +}; + +static struct regulator_init_data aquila_ldo11_data = { + .constraints= { + .name = CAM_IO_2.8V, + .min_uV = 280, + .max_uV = 280, + .apply_uV = 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo12_data = { + .constraints= { + .name = CAM_ISP_1.2V, + .min_uV = 120, + .max_uV = 120, + .apply_uV = 1, + .always_on = 1, + }, +}; + +static struct regulator_init_data aquila_ldo13_data = { + .constraints= { +
Re: [PATCH 2/3] arm: s5pv210: Aquila: add support for MAX8998 PMIC
On Thu, Jul 01, 2010 at 08:07:45AM +0200, Marek Szyprowski wrote: +static struct regulator_consumer_supply aquila_ldo3_consumers[] = { + { .supply = VMIPI_1.1V, }, +}; +static struct regulator_consumer_supply aquila_ldo8_consumers[] = { + { .supply = VADC_3.3V, }, +}; Almost all of these regulator supplies should be removed. Except in some exceptional cases all supplies should specify a struct device (the only one that really exists at the minute is CPU core due to lack of devices for CPUfreq). In general if you're defining a supply name that is the same as the rail on the board rather than a pin on a chip you're not using the API correctly. If you want to label the supply for userspace do so in the constraints. + .constraints= { + .name = VALIVE_1.1V, + .min_uV = 110, + .max_uV = 110, + .apply_uV = 1, + .always_on = 1, + .boot_on= 0, No need to explicitly set stuff to zero. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] arm: s5pv210: Aquila: add support for MAX8998 PMIC
On Thu, Jul 01, 2010 at 03:32:17PM +0200, Marek Szyprowski wrote: One more question - should I enable the regulators in the driver itself or in the platform callback (like a poweron() callback)? I don't understand what you mean by platform callback. Normally the driver would unconditionally use the regulators. If I put regulator enabling into the driver how can one make it working on a board without regulators (chip powered all the time)? Should the driver ignore errors from regulator_get()? No, check the errors. The regulator API will stub itself out if it's not enabled in Kconfig (which will happen on boards where it's not being used at all), boards using a mixed configuration can use fixed voltage regulators for static supplies and REGULATOR_DUMMY can also be used. What if one regulator needs enabling other to operate properly (parent-child hierarchy)? Set up supplies for the child regulators in their constraints. This isn't heavily tested at the minute but it should do the right thing for you automatically in the core; if it doesn't work we can fix it up. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html