linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] [ARM] pxa/cm-x300.c: add battery charger support
@ 2010-03-09  9:43 Igor Grinberg
  2010-03-09  9:43 ` [PATCH 2/5] [ARM] pxa/cm-x300: da903x WLED is not connected on cm-x300 Igor Grinberg
  2010-03-14  9:29 ` [PATCH 1/5] [ARM] pxa/cm-x300.c: add battery charger support Igor Grinberg
  0 siblings, 2 replies; 7+ messages in thread
From: Igor Grinberg @ 2010-03-09  9:43 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 arch/arm/mach-pxa/cm-x300.c |   57 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 56 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index d37cfa1..0e538d8 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -30,6 +30,8 @@
 #include <linux/i2c/pca953x.h>
 
 #include <linux/mfd/da903x.h>
+#include <linux/power_supply.h>
+#include <linux/apm-emulation.h>
 
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_gpio.h>
@@ -584,12 +586,65 @@ static void __init cm_x300_init_rtc(void)
 static inline void cm_x300_init_rtc(void) {}
 #endif
 
+/* Battery */
+struct power_supply_info cm_x300_psy_info = {
+	.name = "battery",
+	.technology = POWER_SUPPLY_TECHNOLOGY_LIPO,
+	.voltage_max_design = 4200000,
+	.voltage_min_design = 3000000,
+	.use_for_apm = 1,
+};
+
+static void cm_x300_battery_low(void)
+{
+#if defined(CONFIG_APM_EMULATION)
+	apm_queue_event(APM_LOW_BATTERY);
+#endif
+}
+
+static void cm_x300_battery_critical(void)
+{
+#if defined(CONFIG_APM_EMULATION)
+	apm_queue_event(APM_CRITICAL_SUSPEND);
+#endif
+}
+
+struct da9030_battery_info cm_x300_battery_info = {
+	.battery_info = &cm_x300_psy_info,
+
+	.charge_milliamp = 1000,
+	.charge_millivolt = 4200,
+
+	.vbat_low = 3600,
+	.vbat_crit = 3400,
+	.vbat_charge_start = 4100,
+	.vbat_charge_stop = 4200,
+	.vbat_charge_restart = 4000,
+
+	.vcharge_min = 3200,
+	.vcharge_max = 5500,
+
+	.tbat_low = 197,
+	.tbat_high = 78,
+	.tbat_restart = 100,
+
+	.batmon_interval = 0,
+
+	.battery_low = cm_x300_battery_low,
+	.battery_critical = cm_x300_battery_critical,
+};
+
 /* DA9030 */
 struct da903x_subdev_info cm_x300_da9030_subdevs[] = {
 	{
 		.name = "da903x-backlight",
 		.id = DA9030_ID_WLED,
-	}
+	},
+	{
+		.name = "da903x-battery",
+		.id = DA9030_ID_BAT,
+		.platform_data = &cm_x300_battery_info,
+	},
 };
 
 static struct da903x_platform_data cm_x300_da9030_info = {
-- 
1.6.4.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] [ARM] pxa/cm-x300: da903x WLED is not connected on cm-x300
  2010-03-09  9:43 [PATCH 1/5] [ARM] pxa/cm-x300.c: add battery charger support Igor Grinberg
@ 2010-03-09  9:43 ` Igor Grinberg
  2010-03-09  9:43   ` [PATCH 3/5] [ARM] pxa/cm-x300: fix da903x IRQ line assignment Igor Grinberg
  2010-03-14  9:29 ` [PATCH 1/5] [ARM] pxa/cm-x300.c: add battery charger support Igor Grinberg
  1 sibling, 1 reply; 7+ messages in thread
From: Igor Grinberg @ 2010-03-09  9:43 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 arch/arm/mach-pxa/cm-x300.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 0e538d8..13fdfd8 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -637,10 +637,6 @@ struct da9030_battery_info cm_x300_battery_info = {
 /* DA9030 */
 struct da903x_subdev_info cm_x300_da9030_subdevs[] = {
 	{
-		.name = "da903x-backlight",
-		.id = DA9030_ID_WLED,
-	},
-	{
 		.name = "da903x-battery",
 		.id = DA9030_ID_BAT,
 		.platform_data = &cm_x300_battery_info,
-- 
1.6.4.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] [ARM] pxa/cm-x300: fix da903x IRQ line assignment
  2010-03-09  9:43 ` [PATCH 2/5] [ARM] pxa/cm-x300: da903x WLED is not connected on cm-x300 Igor Grinberg
@ 2010-03-09  9:43   ` Igor Grinberg
  2010-03-09  9:43     ` [PATCH 4/5] [ARM] pxa/cm-x300: add regulator on vcc_core Igor Grinberg
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Grinberg @ 2010-03-09  9:43 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 arch/arm/mach-pxa/cm-x300.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 13fdfd8..6fba9a0 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -650,7 +650,7 @@ static struct da903x_platform_data cm_x300_da9030_info = {
 
 static struct i2c_board_info cm_x300_pmic_info = {
 	I2C_BOARD_INFO("da9030", 0x49),
-	.irq = IRQ_GPIO(0),
+	.irq = IRQ_WAKEUP0,
 	.platform_data = &cm_x300_da9030_info,
 };
 
-- 
1.6.4.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] [ARM] pxa/cm-x300: add regulator on vcc_core
  2010-03-09  9:43   ` [PATCH 3/5] [ARM] pxa/cm-x300: fix da903x IRQ line assignment Igor Grinberg
@ 2010-03-09  9:43     ` Igor Grinberg
  2010-03-09  9:43       ` [PATCH 5/5] [ARM] pxa/cm-x300: update the memory fixup Igor Grinberg
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Grinberg @ 2010-03-09  9:43 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 arch/arm/mach-pxa/cm-x300.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 6fba9a0..2012588 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -30,6 +30,7 @@
 #include <linux/i2c/pca953x.h>
 
 #include <linux/mfd/da903x.h>
+#include <linux/regulator/machine.h>
 #include <linux/power_supply.h>
 #include <linux/apm-emulation.h>
 
@@ -634,6 +635,27 @@ struct da9030_battery_info cm_x300_battery_info = {
 	.battery_critical = cm_x300_battery_critical,
 };
 
+static struct regulator_consumer_supply buck2_consumers[] = {
+	{
+		.dev = NULL,
+		.supply = "vcc_core",
+	},
+};
+
+static struct regulator_init_data buck2_data = {
+	.constraints = {
+		.min_uV = 1375000,
+		.max_uV = 1375000,
+		.state_mem = {
+			.enabled = 0,
+		},
+		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+		.apply_uV = 1,
+	},
+	.num_consumer_supplies = ARRAY_SIZE(buck2_consumers),
+	.consumer_supplies = buck2_consumers,
+};
+
 /* DA9030 */
 struct da903x_subdev_info cm_x300_da9030_subdevs[] = {
 	{
@@ -641,6 +663,11 @@ struct da903x_subdev_info cm_x300_da9030_subdevs[] = {
 		.id = DA9030_ID_BAT,
 		.platform_data = &cm_x300_battery_info,
 	},
+	{
+		.name = "da903x-regulator",
+		.id = DA9030_ID_BUCK2,
+		.platform_data = &buck2_data,
+	},
 };
 
 static struct da903x_platform_data cm_x300_da9030_info = {
-- 
1.6.4.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] [ARM] pxa/cm-x300: update the memory fixup.
  2010-03-09  9:43     ` [PATCH 4/5] [ARM] pxa/cm-x300: add regulator on vcc_core Igor Grinberg
@ 2010-03-09  9:43       ` Igor Grinberg
  0 siblings, 0 replies; 7+ messages in thread
From: Igor Grinberg @ 2010-03-09  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

CM-X300 bootloader passes DRAM configuration information in ATAGS,
however, the first memory bank is reported at actual physical address 0x8000000.
Use the configuration information supplied by the bootloader and
cope with the necessity to have PHYS_ADDR=0xa0000000.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
---
 arch/arm/mach-pxa/cm-x300.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 2012588..be9dc7a 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -767,13 +767,13 @@ static void __init cm_x300_init(void)
 static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags,
 				 char **cmdline, struct meminfo *mi)
 {
-	mi->nr_banks = 2;
-	mi->bank[0].start = 0xa0000000;
-	mi->bank[0].node = 0;
-	mi->bank[0].size = (64*1024*1024);
-	mi->bank[1].start = 0xc0000000;
-	mi->bank[1].node = 0;
-	mi->bank[1].size = (64*1024*1024);
+	/* Make sure that mi->bank[0].start = PHYS_ADDR */
+	for (; tags->hdr.size; tags = tag_next(tags))
+		if (tags->hdr.tag == ATAG_MEM &&
+			tags->u.mem.start == 0x80000000) {
+			tags->u.mem.start = 0xa0000000;
+			break;
+		}
 }
 
 MACHINE_START(CM_X300, "CM-X300 module")
-- 
1.6.4.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 1/5] [ARM] pxa/cm-x300.c: add battery charger support
  2010-03-09  9:43 [PATCH 1/5] [ARM] pxa/cm-x300.c: add battery charger support Igor Grinberg
  2010-03-09  9:43 ` [PATCH 2/5] [ARM] pxa/cm-x300: da903x WLED is not connected on cm-x300 Igor Grinberg
@ 2010-03-14  9:29 ` Igor Grinberg
  2010-03-16  7:45   ` Eric Miao
  1 sibling, 1 reply; 7+ messages in thread
From: Igor Grinberg @ 2010-03-14  9:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Eric,

Any update on this?

On 03/09/10 11:43, Igor Grinberg wrote:
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> ---
>  arch/arm/mach-pxa/cm-x300.c |   57 ++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 56 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
> index d37cfa1..0e538d8 100644
> --- a/arch/arm/mach-pxa/cm-x300.c
> +++ b/arch/arm/mach-pxa/cm-x300.c
> @@ -30,6 +30,8 @@
>  #include <linux/i2c/pca953x.h>
>  
>  #include <linux/mfd/da903x.h>
> +#include <linux/power_supply.h>
> +#include <linux/apm-emulation.h>
>  
>  #include <linux/spi/spi.h>
>  #include <linux/spi/spi_gpio.h>
> @@ -584,12 +586,65 @@ static void __init cm_x300_init_rtc(void)
>  static inline void cm_x300_init_rtc(void) {}
>  #endif
>  
> +/* Battery */
> +struct power_supply_info cm_x300_psy_info = {
> +	.name = "battery",
> +	.technology = POWER_SUPPLY_TECHNOLOGY_LIPO,
> +	.voltage_max_design = 4200000,
> +	.voltage_min_design = 3000000,
> +	.use_for_apm = 1,
> +};
> +
> +static void cm_x300_battery_low(void)
> +{
> +#if defined(CONFIG_APM_EMULATION)
> +	apm_queue_event(APM_LOW_BATTERY);
> +#endif
> +}
> +
> +static void cm_x300_battery_critical(void)
> +{
> +#if defined(CONFIG_APM_EMULATION)
> +	apm_queue_event(APM_CRITICAL_SUSPEND);
> +#endif
> +}
> +
> +struct da9030_battery_info cm_x300_battery_info = {
> +	.battery_info = &cm_x300_psy_info,
> +
> +	.charge_milliamp = 1000,
> +	.charge_millivolt = 4200,
> +
> +	.vbat_low = 3600,
> +	.vbat_crit = 3400,
> +	.vbat_charge_start = 4100,
> +	.vbat_charge_stop = 4200,
> +	.vbat_charge_restart = 4000,
> +
> +	.vcharge_min = 3200,
> +	.vcharge_max = 5500,
> +
> +	.tbat_low = 197,
> +	.tbat_high = 78,
> +	.tbat_restart = 100,
> +
> +	.batmon_interval = 0,
> +
> +	.battery_low = cm_x300_battery_low,
> +	.battery_critical = cm_x300_battery_critical,
> +};
> +
>  /* DA9030 */
>  struct da903x_subdev_info cm_x300_da9030_subdevs[] = {
>  	{
>  		.name = "da903x-backlight",
>  		.id = DA9030_ID_WLED,
> -	}
> +	},
> +	{
> +		.name = "da903x-battery",
> +		.id = DA9030_ID_BAT,
> +		.platform_data = &cm_x300_battery_info,
> +	},
>  };
>  
>  static struct da903x_platform_data cm_x300_da9030_info = {
>   

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] [ARM] pxa/cm-x300.c: add battery charger support
  2010-03-14  9:29 ` [PATCH 1/5] [ARM] pxa/cm-x300.c: add battery charger support Igor Grinberg
@ 2010-03-16  7:45   ` Eric Miao
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Miao @ 2010-03-16  7:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Mar 14, 2010 at 5:29 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
> Hi Eric,
>
> Any update on this?
>

All look clean and good. Merged into 'devel'.

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-03-16  7:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-09  9:43 [PATCH 1/5] [ARM] pxa/cm-x300.c: add battery charger support Igor Grinberg
2010-03-09  9:43 ` [PATCH 2/5] [ARM] pxa/cm-x300: da903x WLED is not connected on cm-x300 Igor Grinberg
2010-03-09  9:43   ` [PATCH 3/5] [ARM] pxa/cm-x300: fix da903x IRQ line assignment Igor Grinberg
2010-03-09  9:43     ` [PATCH 4/5] [ARM] pxa/cm-x300: add regulator on vcc_core Igor Grinberg
2010-03-09  9:43       ` [PATCH 5/5] [ARM] pxa/cm-x300: update the memory fixup Igor Grinberg
2010-03-14  9:29 ` [PATCH 1/5] [ARM] pxa/cm-x300.c: add battery charger support Igor Grinberg
2010-03-16  7:45   ` Eric Miao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).