Skip to contentSkip to conversation

s3c24xx: iPAQ rx1950 series

PATCH Superseded Vasily Khoruzhick 3 participants 10 messages Jul 17, 2010 – Jul 23, 2010

Subsystems (3)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover s3c24xx: iPAQ rx1950 series

This patch series adds more support for iPAQ rx1950 PDA to linux:
1. LEDs driver -- it controls blue, green and red LEDs on rx1950
2. Battery driver -- adds ability to monitor and charge battery. This driver is suitable for H1940 PDA aswell (just need to write some machine specific callbacks and get voltage LUTs)

v2: removed ac registration from s3c_adc_battery driver, use pda_power instead for ac support

v3: split LEDs patch to driver and machine parts, split battery patch into battery + LED trigger parts, now battery driver can skip gpio/callbacks usage (if there's no gpio pin to determine that battery is full or if charger is enabled automatically)

v4: add .blink_set callback to LEDs driver instead of using LED_HALF value for blinking, remove LED triggers from battery driver completely (for now)

v5: restore lut_acin usage in s3c_adc_battery driver, it was accidently removed during removing AC support from driver

#1 lore raw

PATCH v5 1/4 Add HP iPAQ rx1950 LEDs driver

---
 drivers/leds/Kconfig       |    6 +
 drivers/leds/Makefile      |    1 +
 drivers/leds/leds-rx1950.c |  242 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 249 insertions(+), 0 deletions(-)
 create mode 100644 drivers/leds/leds-rx1950.c
drivers/leds/Kconfig +6 -0
index 81bf25e..f986825 100644
@@ -102,6 +102,12 @@ config LEDS_H1940
 	help
 	  This option enables support for the LEDs on the h1940.
 
+config LEDS_RX1950
+	tristate "LED Support for iPAQ RX1950 device"
+	depends on MACH_RX1950
+	help
+	  This option enables support for the LEDs on the rx1950.
+
 config LEDS_COBALT_QUBE
 	tristate "LED Support for the Cobalt Qube series front LED"
 	depends on MIPS_COBALT
drivers/leds/Makefile +1 -0
index 2493de4..faa0d5d 100644
@@ -17,6 +17,7 @@ obj-$(CONFIG_LEDS_NET5501)		+= leds-net5501.o
 obj-$(CONFIG_LEDS_WRAP)			+= leds-wrap.o
 obj-$(CONFIG_LEDS_ALIX2)		+= leds-alix2.o
 obj-$(CONFIG_LEDS_H1940)		+= leds-h1940.o
+obj-$(CONFIG_LEDS_RX1950)		+= leds-rx1950.o
 obj-$(CONFIG_LEDS_COBALT_QUBE)		+= leds-cobalt-qube.o
 obj-$(CONFIG_LEDS_COBALT_RAQ)		+= leds-cobalt-raq.o
 obj-$(CONFIG_LEDS_SUNFIRE)		+= leds-sunfire.o
drivers/leds/leds-rx1950.c new file +242 -0

242 lines not on this page · raw message

Signature · 1 line
1.7.1.1
#2 lore raw

PATCH v5 2/4 rx1950: add LEDs device

In reply to Vasily Khoruzhick
---
 arch/arm/mach-s3c2440/mach-rx1950.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2440/mach-rx1950.c +6 -0
index 8603b57..55b806a 100644
@@ -126,6 +126,11 @@ static struct s3c2410fb_display rx1950_display = {
 
 };
 
+static struct platform_device rx1950_device_leds = {
+	.name             = "rx1950-leds",
+	.id               = -1,
+};
+
 static struct s3c2410fb_mach_info rx1950_lcd_cfg = {
 	.displays = &rx1950_display,
 	.num_displays = 1,
@@ -502,6 +507,7 @@ static struct platform_device *rx1950_devices[] __initdata = {
 	&s3c_device_timer[1],
 	&rx1950_backlight,
 	&rx1950_device_gpiokeys,
+	&rx1950_device_leds,
 };
 
 static struct clk *rx1950_clocks[] __initdata = {
Signature · 1 line
1.7.1.1
#3 lore raw

PATCH v5 3/4 Add s3c-adc-battery driver

In reply to Vasily Khoruzhick

s3c-adc-battery is driver for monitoring
and charging battery on iPAQ H1930/H1940/RX1950.
It depends on s3c-adc driver to get battery voltage and current.

---
 drivers/power/Kconfig           |    6 +
 drivers/power/Makefile          |    1 +
 drivers/power/s3c_adc_battery.c |  433 +++++++++++++++++++++++++++++++++++++++
 include/linux/s3c_adc_battery.h |   36 ++++
 4 files changed, 476 insertions(+), 0 deletions(-)
 create mode 100644 drivers/power/s3c_adc_battery.c
 create mode 100644 include/linux/s3c_adc_battery.h
drivers/power/Kconfig +6 -0
index 8e9ba17..645baa5 100644
@@ -136,6 +136,12 @@ config BATTERY_Z2
 	help
 	  Say Y to include support for the battery on the Zipit Z2.
 
+config BATTERY_S3C_ADC
+	tristate "Battery driver for Samsung ADC based monitoring"
+	depends on S3C_ADC
+	help
+	  Say Y here to enable support for iPAQ h1930/h1940/rx1950 battery
+
 config CHARGER_PCF50633
 	tristate "NXP PCF50633 MBC"
 	depends on MFD_PCF50633
drivers/power/Makefile +1 -0
index 0005080..166bcbf 100644
@@ -33,4 +33,5 @@ obj-$(CONFIG_BATTERY_BQ27x00)	+= bq27x00_battery.o
 obj-$(CONFIG_BATTERY_DA9030)	+= da9030_battery.o
 obj-$(CONFIG_BATTERY_MAX17040)	+= max17040_battery.o
 obj-$(CONFIG_BATTERY_Z2)	+= z2_battery.o
+obj-$(CONFIG_BATTERY_S3C_ADC)	+= s3c_adc_battery.o
 obj-$(CONFIG_CHARGER_PCF50633)	+= pcf50633-charger.o
drivers/power/s3c_adc_battery.c new file +433 -0

433 lines not on this page · raw message

include/linux/s3c_adc_battery.h new file +36 -0
new file mode 100644
index 0000000..dbce22f
@@ -0,0 +1,36 @@
+#ifndef _S3C_ADC_BATTERY_H
+#define _S3C_ADC_BATTERY_H
+
+struct s3c_adc_bat_thresh {
+	int volt; /* mV */
+	int cur; /* mA */
+	int level; /* percent */
+};
+
+struct s3c_adc_bat_pdata {
+	int (*init)(void);
+	void (*exit)(void);
+	void (*enable_charger)(void);
+	void (*disable_charger)(void);
+
+	int gpio_charge_finished;
+
+	const struct s3c_adc_bat_thresh *lut_noac;
+	unsigned int lut_noac_cnt;
+	const struct s3c_adc_bat_thresh *lut_acin;
+	unsigned int lut_acin_cnt;
+
+	const unsigned int volt_channel;
+	const unsigned int current_channel;
+	const unsigned int backup_volt_channel;
+
+	const unsigned int volt_mult;
+	const unsigned int current_mult;
+	const unsigned int backup_volt_mult;
+	const unsigned int internal_impedance;
+
+	const unsigned int backup_volt_max;
+	const unsigned int backup_volt_min;
+};
+
+#endif
Signature · 1 line
1.7.1.1
#4 lore raw

PATCH v5 3/4 Add s3c-adc-battery driver

Quoted 6 lines · Vasily Khoruzhick

s3c-adc-battery is driver for monitoring
and charging battery on iPAQ H1930/H1940/RX1950.
It depends on s3c-adc driver to get battery voltage and current.

---

I'll try and have a look over this in the next few days.

Signature · 3 lines
Ben Dooks, Design & Software Engineer, Simtec Electronics

http://www.simtec.co.uk/
#5 lore raw

PATCH v5 3/4 Add s3c-adc-battery driver

In reply to Vasily Khoruzhick
Quoted 6 lines · Vasily Khoruzhick

s3c-adc-battery is driver for monitoring
and charging battery on iPAQ H1930/H1940/RX1950.
It depends on s3c-adc driver to get battery voltage and current.

---

Applied to battery-2.6.git (for -next) with a few cosmetic fixes.

If/when Ben comment on this driver, feel free to send fixups on top of battery-2.6.git.

Also, I can take patch 4/4 if Ben ack it.

Thanks,

Signature · 3 lines
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2
#6 lore raw

PATCH v5 3/4 Add s3c-adc-battery driver

? ????????? ?? 23 ???? 2010 16:18:33 ????? Anton Vorontsov ???????:

Quoted 10 lines · Vasily Khoruzhick
Quoted 6 lines

s3c-adc-battery is driver for monitoring
and charging battery on iPAQ H1930/H1940/RX1950.
It depends on s3c-adc driver to get battery voltage and current.

---

Applied to battery-2.6.git (for -next) with a few cosmetic fixes.

Thanks :)

Quoted 4 lines

If/when Ben comment on this driver, feel free to send fixups on top of battery-2.6.git.

Also, I can take patch 4/4 if Ben ack it.

It depends on 2/4 patch. Btw, I'm going to re-send machine specific patches in few hours (I droped rx1950-specific LEDs driver, gpio-leds is used instead).

Regards
Vasily
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100723/7202b48b/attachment.sig>

#7 lore raw

PATCH v5 4/4 rx1950: add battery device

In reply to Vasily Khoruzhick
---
 arch/arm/mach-s3c2440/Kconfig       |    3 +
 arch/arm/mach-s3c2440/mach-rx1950.c |  160 +++++++++++++++++++++++++++++++++++
 2 files changed, 163 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2440/Kconfig +3 -0
index cd8e7de..9b6b026 100644
@@ -198,6 +198,9 @@ config MACH_RX1950
 	select S3C_DEV_NAND
 	select S3C2410_IOTIMING if S3C2440_CPUFREQ
 	select S3C2440_XTAL_16934400
+	select S3C_ADC
+	select PDA_POWER
+	select BATTERY_S3C_ADC
 	help
 	   Say Y here if you're using HP iPAQ rx1950
 
arch/arm/mach-s3c2440/mach-rx1950.c +160 -0

180 lines not on this page · raw message

Signature · 1 line
1.7.1.1
#8 lore raw

v5 cover s3c24xx: iPAQ rx1950 series

In reply to Vasily Khoruzhick

? ????????? ?? 17 ???? 2010 13:57:00 ????? Vasily Khoruzhick ???????:

Quoted 15 lines

This patch series adds more support for iPAQ rx1950 PDA to linux:
1. LEDs driver -- it controls blue, green and red LEDs on rx1950
2. Battery driver -- adds ability to monitor and charge battery. This driver is suitable for H1940 PDA aswell (just need to write some machine specific callbacks and get voltage LUTs)

v2: removed ac registration from s3c_adc_battery driver, use pda_power instead for ac support

v3: split LEDs patch to driver and machine parts, split battery patch into battery + LED trigger parts, now battery driver can skip gpio/callbacks usage (if there's no gpio pin to determine that battery is full or if charger is enabled automatically)

Quoted 7 lines

v4: add .blink_set callback to LEDs driver instead of using LED_HALF value for blinking, remove LED triggers from battery driver completely (for now)

v5: restore lut_acin usage in s3c_adc_battery driver, it was accidently removed during removing AC support from driver

Ping :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100720/137d6a02/attachment.sig>

#9 lore raw

v5 cover s3c24xx: iPAQ rx1950 series

? ????????? ?? 20 ???? 2010 15:35:14 ????? Vasily Khoruzhick ???????:

Quoted 20 lines

? ????????? ?? 17 ???? 2010 13:57:00 ????? Vasily Khoruzhick ???????:

Quoted 19 lines

This patch series adds more support for iPAQ rx1950 PDA to linux:
1. LEDs driver -- it controls blue, green and red LEDs on rx1950
2. Battery driver -- adds ability to monitor and charge battery. This driver is suitable for H1940 PDA aswell (just need to write some machine specific callbacks and get voltage LUTs)

v2: removed ac registration from s3c_adc_battery driver, use pda_power instead for ac support

v3: split LEDs patch to driver and machine parts, split battery patch into battery + LED trigger parts, now battery driver can skip gpio/callbacks usage (if there's no gpio pin to determine that battery is full or if charger is enabled automatically)

v4: add .blink_set callback to LEDs driver instead of using LED_HALF value for blinking, remove LED triggers from battery driver completely (for now)

Quoted 5 lines
Quoted 3 lines

v5: restore lut_acin usage in s3c_adc_battery driver, it was accidently removed during removing AC support from driver

Ping :)

Ping once again :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100723/baed7e4a/attachment.sig>