From c9c669ebb5108b48b296403c6b3603afafa075cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BC=A0=E6=99=B4?= Date: Tue, 29 Jan 2013 11:51:05 +0800 Subject: [PATCH] rk31xx:support new pwm circuit for new tps65910 --- arch/arm/mach-rk30/board-rk3168-86v.c | 10 +++++----- arch/arm/mach-rk30/board-rk3168-ds1006h.c | 10 +++++----- arch/arm/mach-rk30/board-rk3168-tb.c | 13 ++++++------- arch/arm/mach-rk3188/board-rk3188-ds1006h.c | 10 +++++----- drivers/regulator/rk30-pwm-regulator.c | 8 +++++++- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk3168-86v.c b/arch/arm/mach-rk30/board-rk3168-86v.c index 87b18d44e506..16d5a1ceeafe 100755 --- a/arch/arm/mach-rk30/board-rk3168-86v.c +++ b/arch/arm/mach-rk30/board-rk3168-86v.c @@ -920,7 +920,7 @@ static struct platform_device rk30_device_adc_battery = { #endif #ifdef CONFIG_RK30_PWM_REGULATOR static int pwm_voltage_map[] = { - 950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000 + 800000,825000,850000, 875000,900000, 925000 ,950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000,1375000 }; static struct regulator_consumer_supply pwm_dcdc1_consumers[] = { @@ -951,10 +951,10 @@ static struct pwm_platform_data pwm_regulator_info[1] = { .pwm_iomux_pwm = PWM1, .pwm_iomux_gpio = GPIO3_D4, .pwm_voltage = 1100000, - .suspend_voltage = 1050000, - .min_uV = 950000, - .max_uV = 1400000, - .coefficient = 455, //45.5% + .suspend_voltage = 1000000, + .min_uV = 800000, + .max_uV = 1375000, + .coefficient = 575, //55.0% .pwm_voltage_map = pwm_voltage_map, .init_data = &pwm_regulator_init_dcdc[0], }, diff --git a/arch/arm/mach-rk30/board-rk3168-ds1006h.c b/arch/arm/mach-rk30/board-rk3168-ds1006h.c index fc3072143b58..39c88828e56a 100755 --- a/arch/arm/mach-rk30/board-rk3168-ds1006h.c +++ b/arch/arm/mach-rk30/board-rk3168-ds1006h.c @@ -810,7 +810,7 @@ static struct platform_device rk30_device_adc_battery = { #endif #ifdef CONFIG_RK30_PWM_REGULATOR static int pwm_voltage_map[] = { - 950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000 + 800000,825000,850000, 875000,900000, 925000 ,950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000,1375000 }; static struct regulator_consumer_supply pwm_dcdc1_consumers[] = { @@ -841,10 +841,10 @@ static struct pwm_platform_data pwm_regulator_info[1] = { .pwm_iomux_pwm = PWM1, .pwm_iomux_gpio = GPIO3_D4, .pwm_voltage = 1100000, - .suspend_voltage = 1050000, - .min_uV = 950000, - .max_uV = 1400000, - .coefficient = 455, //45.5% + .suspend_voltage = 1000000, + .min_uV = 800000, + .max_uV = 1375000, + .coefficient = 575, //57.5% .pwm_voltage_map = pwm_voltage_map, .init_data = &pwm_regulator_init_dcdc[0], }, diff --git a/arch/arm/mach-rk30/board-rk3168-tb.c b/arch/arm/mach-rk30/board-rk3168-tb.c index 9625a97a924c..396b1e4037eb 100755 --- a/arch/arm/mach-rk30/board-rk3168-tb.c +++ b/arch/arm/mach-rk30/board-rk3168-tb.c @@ -1021,10 +1021,9 @@ static struct platform_device rk30_device_adc_battery = { }; #endif #ifdef CONFIG_RK30_PWM_REGULATOR -const static int pwm_voltage_map[] = { - 950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000 +static int pwm_voltage_map[] = { + 800000,825000,850000, 875000,900000, 925000 ,950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000,1375000 }; - static struct regulator_consumer_supply pwm_dcdc1_consumers[] = { { .supply = "vdd_cpu", @@ -1053,10 +1052,10 @@ static struct pwm_platform_data pwm_regulator_info[1] = { .pwm_iomux_pwm = PWM1, .pwm_iomux_gpio = GPIO3_D4, .pwm_voltage = 1100000, - .suspend_voltage = 1050000, - .min_uV = 950000, - .max_uV = 1400000, - .coefficient = 455, //45.5% + .suspend_voltage = 1000000, + .min_uV = 800000, + .max_uV = 1375000, + .coefficient = 575, //57.5% .pwm_voltage_map = pwm_voltage_map, .init_data = &pwm_regulator_init_dcdc[0], }, diff --git a/arch/arm/mach-rk3188/board-rk3188-ds1006h.c b/arch/arm/mach-rk3188/board-rk3188-ds1006h.c index 8a66f4a82ce0..21a819696096 100755 --- a/arch/arm/mach-rk3188/board-rk3188-ds1006h.c +++ b/arch/arm/mach-rk3188/board-rk3188-ds1006h.c @@ -833,7 +833,7 @@ static struct platform_device rk30_device_adc_battery = { #endif #ifdef CONFIG_RK30_PWM_REGULATOR static int pwm_voltage_map[] = { - 950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000 + 800000,825000,850000, 875000,900000, 925000 ,950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000,1375000 }; static struct regulator_consumer_supply pwm_dcdc1_consumers[] = { @@ -864,10 +864,10 @@ static struct pwm_platform_data pwm_regulator_info[1] = { .pwm_iomux_pwm = PWM1, .pwm_iomux_gpio = GPIO3_D4, .pwm_voltage = 1100000, - .suspend_voltage = 1050000, - .min_uV = 950000, - .max_uV = 1400000, - .coefficient = 455, //45.5% + .suspend_voltage = 1000000, + .min_uV = 800000, + .max_uV = 1375000, + .coefficient = 575, //57.5% .pwm_voltage_map = pwm_voltage_map, .init_data = &pwm_regulator_init_dcdc[0], }, diff --git a/drivers/regulator/rk30-pwm-regulator.c b/drivers/regulator/rk30-pwm-regulator.c index bead02ecb183..b593d7fd6340 100755 --- a/drivers/regulator/rk30-pwm-regulator.c +++ b/drivers/regulator/rk30-pwm-regulator.c @@ -47,9 +47,15 @@ struct rk_pwm_dcdc { struct pwm_platform_data *pdata; }; +#if defined(CONFIG_SOC_RK3168) || defined(CONFIG_ARCH_RK3188) +const static int pwm_voltage_map[] = { + 800000,825000,850000, 875000,900000, 925000 ,950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000,1375000 +}; +#else const static int pwm_voltage_map[] = { 950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000 }; +#endif static struct rk_pwm_dcdc *g_dcdc; @@ -291,7 +297,7 @@ static int __devinit pwm_regulator_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dcdc); printk(KERN_INFO "pwm_regulator.%d: driver initialized\n",id); pwm_regulator_set_voltage(dcdc->regulator,pdata->pwm_voltage,pdata->pwm_voltage,&selector); - + return 0; -- 2.34.1