Skip to contentSkip to conversation

s3c24xx: iPAQ rx1950 series

PATCH Superseded Vasily Khoruzhick 1 participant 6 messages Jul 17, 2010

Subsystems (3)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 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)

#1 lore raw

PATCH v4 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 v4 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 v4 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 |  426 +++++++++++++++++++++++++++++++++++++++
 include/linux/s3c_adc_battery.h |   36 ++++
 4 files changed, 469 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 +426 -0

426 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 v4 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
#5 lore raw

v4 cover s3c24xx: iPAQ rx1950 series

In reply to Vasily Khoruzhick

? ????????? ?? 17 ???? 2010 11:18:32 ????? 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 3 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)

Oops, I accidently removed lut_acin assignment, please discard this series version.

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/20100717/fa52ce87/attachment-0001.sig>