s3c24xx: iPAQ rx1950 series
Subsystems (3)
v3 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)
PATCH v3 1/5 Add HP iPAQ rx1950 LEDs driver
--- drivers/leds/Kconfig | 6 ++ drivers/leds/Makefile | 1 + drivers/leds/leds-rx1950.c | 206 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 213 insertions(+), 0 deletions(-) create mode 100644 drivers/leds/leds-rx1950.c
drivers/leds/Kconfig +6 -0
@@ -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
@@ -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 +206 -0
206 lines not on this page · raw message
Signature · 1 line
1.7.1.1
PATCH v3 2/5 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
@@ -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
PATCH v3 3/5 Add s3c-adc-battery driver
In reply to Vasily Khoruzhicks3c-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
@@ -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
@@ -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
@@ -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
PATCH v3 4/5 s3c_adc_battery: add LED trigger
In reply to Vasily Khoruzhick--- drivers/power/s3c_adc_battery.c | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-)
drivers/power/s3c_adc_battery.c +26 -0
@@ -38,6 +38,10 @@ struct s3c_adc_bat { int cable_plugged:1; }; +#ifdef CONFIG_LEDS_TRIGGERS +DEFINE_LED_TRIGGER (charger_led_trigger); +#endif +static struct delayed_work bat_work;static void s3c_adc_bat_ext_power_changed (struct power_supply *psy)
@@ -219,10 +223,16 @@ static void s3c_adc_bat_work(struct work_struct *work)if (is_plugged != was_plugged) { was_plugged = is_plugged;if (is_plugged) { +#ifdef CONFIG_LEDS_TRIGGERS +led_trigger_event (charger_led_trigger,LED_HALF ); +#endif if (bat->pdata->enable_charger) bat->pdata->enable_charger (); bat->status =POWER_SUPPLY_STATUS_CHARGING ; }else { +#ifdef CONFIG_LEDS_TRIGGERS +led_trigger_event (charger_led_trigger,LED_OFF ); +#endif if (bat->pdata->disable_charger) bat->pdata->disable_charger (); bat->status =POWER_SUPPLY_STATUS_DISCHARGING ;
@@ -232,10 +242,18 @@ static void s3c_adc_bat_work(struct work_struct *work) is_charged =gpio_get_value ( main_bat.pdata->gpio_charge_finished);if (is_charged) { +#ifdef CONFIG_LEDS_TRIGGERS +led_trigger_event (charger_led_trigger, +LED_FULL ); +#endif if (bat->pdata->disable_charger) bat->pdata->disable_charger (); bat->status =POWER_SUPPLY_STATUS_FULL ; }else { +#ifdef CONFIG_LEDS_TRIGGERS +led_trigger_event (charger_led_trigger, +LED_HALF ); +#endif if (bat->pdata->enable_charger) bat->pdata->enable_charger (); bat->status =POWER_SUPPLY_STATUS_CHARGING ;
@@ -307,6 +325,10 @@ static int __init s3c_adc_bat_probe(struct platform_device *pdev) goto err_platform; } +#ifdef CONFIG_LEDS_TRIGGERS +led_trigger_register_simple ("s3c-adc-charger" , &charger_led_trigger); +#endif +dev_info (&pdev->dev,"successfully loaded\n" );device_init_wakeup (&pdev->dev,1 );
@@ -336,6 +358,10 @@ static int s3c_adc_bat_remove(struct platform_device *pdev)struct s3c_adc_client *client =platform_get_drvdata (pdev);struct s3c_adc_bat_pdata *pdata = pdev->dev.platform_data; +#ifdef CONFIG_LEDS_TRIGGERS +led_trigger_unregister_simple (charger_led_trigger); +#endif +power_supply_unregister (&main_bat.psy);if (pdata->backup_volt_mult)power_supply_unregister (&backup_bat.psy);
Signature · 1 line
1.7.1.1
PATCH v3 5/5 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
@@ -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