[RFC/RFT][PATCH 1/4] regulator: core: Allow specify activate_[reg|bit] for regmap based voltage_sel operations

2012-12-13 Thread Axel Lin
. Signed-off-by: Axel Lin --- drivers/regulator/core.c | 12 +++- include/linux/regulator/driver.h |6 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 0f65b24..2021086 100644 --- a/drivers/regulator

[RFC/RFT][PATCH 2/4] regulator: 88pm8607: Use activate_[reg|bit] with regmap based voltage_sel operations

2012-12-13 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/88pm8607.c | 43 -- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index 2b55711..21a7334 100644 --- a/drivers/regulator/88pm8607.c

[RFC/RFT][PATCH 3/4] regulator: da9052: Use activate_[reg|bit] with regmap based voltage_sel operations

2012-12-13 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/da9052-regulator.c | 41 +- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index d096309..47455ad 100644 --- a/drivers

[RFC/RFT][PATCH 4/4] regulator: tps6586x: Use activate_[reg|bit] with regmap based voltage_sel operations

2012-12-13 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/tps6586x-regulator.c | 54 ++-- 1 file changed, 10 insertions(+), 44 deletions(-) diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c index f86da67..1b5e8b9 100644 --- a/drivers

[PATCH 1/6] iio: adc: ad7266: Don't set error code to st->vref_uv

2012-12-13 Thread Axel Lin
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to st->vref_uv. Signed-off-by: Axel Lin --- drivers/iio/adc/ad7266.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/

[PATCH 2/6] iio: dac: ad5380: Don't set error code to st->vref

2012-12-13 Thread Axel Lin
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to st->vref_uv. Signed-off-by: Axel Lin --- drivers/iio/dac/ad5380.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/

[PATCH 3/6] iio: dac: ad5504: Don't set error code to voltage_uv

2012-12-13 Thread Axel Lin
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv. Signed-off-by: Axel Lin --- drivers/iio/dac/ad5504.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac

[PATCH 4/6] iio: dac: ad5624r_spi: Don't set error code to voltage_uv

2012-12-13 Thread Axel Lin
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv. Signed-off-by: Axel Lin --- drivers/iio/dac/ad5624r_spi.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5624r_spi.c b/drivers/iio

[PATCH 5/6] iio: dac: ad5686: Don't set error code to voltage_uv

2012-12-13 Thread Axel Lin
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv. Signed-off-by: Axel Lin --- drivers/iio/dac/ad5686.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac

[PATCH 6/6] iio: dac: ad5791: Don't set error code to [pos|neg]_voltage_uv

2012-12-13 Thread Axel Lin
regulator_get_voltage() may return negative error code. Don't set error code to to pos_voltage_uv and neg_voltage_uv. Signed-off-by: Axel Lin --- drivers/iio/dac/ad5791.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/iio/dac/ad5791.c b/driver

[PATCH v2 3/6] iio: dac: ad5504: Don't set error code to voltage_uv

2012-12-14 Thread Axel Lin
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv. Signed-off-by: Axel Lin --- v2: check if ret is negative value drivers/iio/dac/ad5504.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio

[PATCH v2 4/6] iio: dac: ad5624r_spi: Don't set error code to voltage_uv

2012-12-14 Thread Axel Lin
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv. Signed-off-by: Axel Lin --- v2: check if ret is negative value drivers/iio/dac/ad5624r_spi.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH v2 5/6] iio: dac: ad5686: Don't set error code to voltage_uv

2012-12-14 Thread Axel Lin
regulator_get_voltage() may return negative error code. Add error checking to avoid setting error code to voltage_uv. Signed-off-by: Axel Lin --- v2: check if ret is negative value drivers/iio/dac/ad5686.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio

[PATCH] extcon: adc-jack: Fix checking return value of request_any_context_irq

2012-09-27 Thread Axel Lin
On failure, request_any_context_irq() returns a negative value. On success, it returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED. Also ensure adc_jack_probe() return 0 on success. Signed-off-by: Axel Lin --- drivers/extcon/extcon-adc-jack.c |5 ++--- 1 file changed, 2 insertions(+), 3

[PATCH] extcon: adc-jack: Add missing MODULE_LICENSE

2012-09-27 Thread Axel Lin
This driver can be built as a module, add MODULE_LICENSE for it. For completeness, also adds MODULE_AUTHOR and MODULE_DESCRIPTION. Signed-off-by: Axel Lin --- drivers/extcon/extcon-adc-jack.c |5 + 1 file changed, 5 insertions(+) diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers

[PATCH] gpio: mvebu: Add missing breaks in mvebu_gpio_irq_set_type

2012-09-30 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/gpio/gpio-mvebu.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c index 902af43..7a874129 100644 --- a/drivers/gpio/gpio-mvebu.c +++ b/drivers/gpio/gpio-mvebu.c @@ -381,11 +381,13 @@ static int

[PATCH] backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe

2012-09-30 Thread Axel Lin
Otherwise, we got NULL derefernce while calling backlight_device_unregister() in tps65217_bl_remove(). Also convert to use module_platform_driver. Signed-off-by: Axel Lin --- drivers/video/backlight/tps65217_bl.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff

[PATCH] rtc: hid-sensor-time: Add missing spin_lock_init

2013-01-16 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/rtc/rtc-hid-sensor-time.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c index 0438c9e..31c5728 100644 --- a/drivers/rtc/rtc-hid-sensor-time.c +++ b/drivers/rtc/rtc-hid-sensor

[PATCH] regulator: lp8788-buck: Remove buck[1|2]_vout_addr array

2013-01-16 Thread Axel Lin
The vout address for buck[1|2] can be easily calculated, thus remote these arrays. Signed-off-by: Axel Lin --- drivers/regulator/lp8788-buck.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c

[PATCH RESEND] regulator: s5m8767: Convert to regulator_[get|set]_voltage_sel_regmap

2013-01-17 Thread Axel Lin
Signed-off-by: Axel Lin --- This patch was sent on https://lkml.org/lkml/2012/12/28/91 This resend re-generate the patch against topic/s5m8767 branch. drivers/regulator/s5m8767.c | 50 +++ 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a

[PATCH] regulator: lp872x: Remove _rdev_to_offset() function

2013-01-17 Thread Axel Lin
There is only one caller calling _rdev_to_offset(), and the code looks simper if we remove _rdev_to_offset(). Thus remove it. Signed-off-by: Axel Lin --- drivers/regulator/lp872x.c | 32 +--- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/drivers

[PATCH 1/2] regulator: wm8994: Convert wm8994_ldo2_ops to use regulator_list_voltage_linear

2013-01-17 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/wm8994-regulator.c | 57 -- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index 6ff8723..fef2692 100644 --- a/drivers

[PATCH 2/2] regulator: wm8994: Merge wm8994_ldo1_ops and wm8994_ldo2_ops

2013-01-17 Thread Axel Lin
wm8994_ldo1_ops and wm8994_ldo2_ops are the same after converting wm8994_ldo2_ops to use regulator_list_voltage_linear, merge them. Signed-off-by: Axel Lin --- drivers/regulator/wm8994-regulator.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH] regulator: tps62360: Convert to devm_gpio_request_one

2012-07-06 Thread Axel Lin
Use devm_gpio_request_one to save a few error handling code. Also remove trivial comment for tps62360_remove. Signed-off-by: Axel Lin --- drivers/regulator/tps62360-regulator.c | 38 +++- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/drivers

[PATCH] regulator: da9052: Use for_each_child_of_node() macro

2012-07-06 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/da9052-regulator.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index 88976d8..5f8f71a 100644 --- a/drivers/regulator/da9052-regulator.c +++ b

[PATCH RFT 1/2] regulator: twl: Fix the formula to calculate vsel and voltage for twl6030ldo

2012-07-08 Thread Axel Lin
the equation to: (This equation is common for linear mapping) return rdev->desc->min_uV + vsel * rdev->desc->uV_step; Signed-off-by: Axel Lin --- drivers/regulator/twl-regulator.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git

[PATCH RFT 2/2] regulator: twl: Convert twl6030ldo_ops to [get|set]_voltage_sel

2012-07-08 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/twl-regulator.c | 24 +++- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index bb51dec..de99b78 100644 --- a/drivers/regulator/twl

[RESEND][PATCH RFT 2/2] regulator: twl: Convert twl6030ldo_ops to [get|set]_voltage_sel

2012-07-08 Thread Axel Lin
Signed-off-by: Axel Lin --- Sorry, I CCed wrong guys. So here is the resend. Axel drivers/regulator/twl-regulator.c | 24 +++- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index bb51dec

Re: [PATCH RFT 1/2] regulator: twl: Fix the formula to calculate vsel and voltage for twl6030ldo

2012-07-09 Thread Axel Lin
於 一,2012-07-09 於 11:22 +0800,Axel Lin 提到: > In twl6030ldo_set_voltage, current code use below formula to calculate vsel: > vsel = (min_uV/1000 - 1000)/100 + 1; > This is worng because when min_uV is 100 uV, vsel is 1. > It should be 0 in this case. > Fix it by change

[PATCH] regulator: da9055: Remove unused v_shift field from struct da9055_volt_reg

2013-01-05 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/da9055-regulator.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c index 1a05ac6..3022109 100644 --- a/drivers/regulator/da9055-regulator.c +++ b/drivers/regulator

[PATCH] regulator: lp8755: Remove enum bucks

2013-01-06 Thread Axel Lin
We already have enum lp8755_bucks in lp8755.h, so it looks pointless adding enum bucks in lp8755.c. Signed-off-by: Axel Lin --- drivers/regulator/lp8755.c | 50 +++- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/drivers/regulator

[PATCH] backlight: l4f00242t03: Convert to devm_regulator_get

2013-01-06 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/video/backlight/l4f00242t03.c | 24 +--- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index 9bef9cf..fb61557 100644 --- a/drivers/video

[PATCH v2] regulator: max8998: Ensure enough delay time for max8998_set_voltage_buck_time_sel

2013-01-09 Thread Axel Lin
Use DIV_ROUND_UP to prevent truncation by integer division issue. This ensures we return enough delay time. Signed-off-by: Axel Lin --- v2: Only fix integer division truncation issue, remove other optimization. drivers/regulator/max8998.c |2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH RFT] regulator: lp8788-buck: Silence build warning

2013-01-09 Thread Axel Lin
/regulator/lp8788-buck.c:489:63: warning: array subscript is above array bounds [-Warray-bounds] Reported-by: Fengguang Wu Signed-off-by: Axel Lin --- Hi Fengguang, My toolchain does not show the warning you mentioned, can you test if this patch indeed silence the build warning? Thanks, Axe

Re: [PATCH] phy: meson-usb2: Fix build dependency

2016-09-20 Thread Axel Lin
2016-09-21 12:06 GMT+08:00 Kishon Vijay Abraham I : > > > On Monday 19 September 2016 10:14 PM, Kevin Hilman wrote: >> Martin Blumenstingl writes: >> >>> Hi Axel, >>> >>> On Fri, Sep 16, 2016 at 4:07 AM, Axel Lin wrote: >>>> of_usb

[PATCH] regulator: lp873x: Drop _nlr parameter from LP873X_REGULATOR()

2016-06-20 Thread Axel Lin
No need to pass _nlr to LP873X_REGULATOR(), use ARRAY_SIZE to calculate it. Signed-off-by: Axel Lin --- drivers/regulator/lp873x-regulator.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/lp873x-regulator.c b/drivers/regulator/lp873x

[PATCH] mfd: altera-a10sr: Make altr_a10sr_regmap_config static const

2016-08-04 Thread Axel Lin
It's only used in this driver and never get modified, make it static const. Signed-off-by: Axel Lin --- drivers/mfd/altera-a10sr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/altera-a10sr.c b/drivers/mfd/altera-a10sr.c index c05aa4f..40ed65e 100644

[PATCH] regulator: axp20x: Simplify axp20x_is_polyphase_slave implementation

2017-10-15 Thread Axel Lin
The code to handle AXP803_ID and AXP813_ID cases are exactly the same. Make the switch-case fall through to avoid duplicate code. Signed-off-by: Axel Lin --- drivers/regulator/axp20x-regulator.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/regulator

[PATCH] regulator: bd9571mwv: Statize local symbols

2017-05-27 Thread Axel Lin
These functions are only used by this driver, make them static. Signed-off-by: Axel Lin --- drivers/regulator/bd9571mwv-regulator.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c

[PATCH] regulator: tps65218: Add NULL test for devm_kzalloc call

2017-11-13 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/tps65218-regulator.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c index bc489958fed7..b3f89ebfb1a0 100644 --- a/drivers/regulator/tps65218-regulator.c +++ b

[PATCH] regulator: tps65218: Remove unused enum tps65218_regulators

2017-11-13 Thread Axel Lin
The enum tps65218_regulators is no longer being used after commit 2dc4940360d4 ("regulator: tps65218: Remove all the compatibles"). Signed-off-by: Axel Lin --- drivers/regulator/tps65218-regulator.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/regulator/tps65218-regu

[PATCH RFT] regulator: tps6105x: Convert to use regmap helper functions

2015-10-06 Thread Axel Lin
Since commit 7e5071199355 ("mfd: tps6105x: Use i2c regmap to access registers"), we can use regmap helper functions instead of open coded. Signed-off-by: Axel Lin --- Hi Grigoryev, I don't have this h/w, can you help test this patch? Thanks. This patch depends on commit 7e

[PATCH] mfd: Make TPS6105X select REGMAP_I2C

2015-10-06 Thread Axel Lin
This is required since commit 7e5071199355 ("mfd: tps6105x: Use i2c regmap to access registers"). Signed-off-by: Axel Lin --- drivers/mfd/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 87e84e7..0063c92 100644 --- a/drivers/m

[PATCH] reset: Add (devm_)reset_control_get stub functions

2015-08-31 Thread Axel Lin
So the drivers can be compiled with CONFIG_RESET_CONTROLLER disabled. Signed-off-by: Axel Lin --- include/linux/reset.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/reset.h b/include/linux/reset.h index da5602b..cd42c1b 100644 --- a/include/linux/reset.h +++ b

[PATCH v2] reset: Add (devm_)reset_control_get stub functions

2015-08-31 Thread Axel Lin
So the drivers can be compiled with CONFIG_RESET_CONTROLLER disabled. Signed-off-by: Axel Lin --- v2: Add __must_check and WARN_ON(1); And make it return ERR_PTR(-EINVAL). include/linux/reset.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/reset.h b/include

[PATCH] reset: ath79: Fix missing spin_lock_init

2015-09-01 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/reset/reset-ath79.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/reset/reset-ath79.c b/drivers/reset/reset-ath79.c index d2d2904..9aaf646 100644 --- a/drivers/reset/reset-ath79.c +++ b/drivers/reset/reset-ath79.c @@ -89,6 +89,7 @@ static int

[PATCH] irqchip/i8259: Convert to use irq_set_chained_handler_and_data

2015-10-01 Thread Axel Lin
Chained irq handlers usually set up handler data as well. We now have a function to set both under irq_desc->lock. Replace the two calls with one. Signed-off-by: Axel Lin --- drivers/irqchip/irq-i8259.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/

[PATCH] regulator: isl9305: Add missing .owner field in regulator_desc

2018-08-27 Thread Axel Lin
Add missing .owner field in regulator_desc, which is used for refcounting. Signed-off-by: Axel Lin --- drivers/regulator/isl9305.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/regulator/isl9305.c b/drivers/regulator/isl9305.c index 257c1943e753..9c2607e912cf 100644 --- a

[PATCH] regulator: bd71837: Remove duplicate assignment for n_voltages of LDO2

2018-08-24 Thread Axel Lin
Set it once is enough. Also move n_voltages close to volt_table for better readability. Signed-off-by: Axel Lin --- drivers/regulator/bd71837-regulator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/regulator/bd71837-regulator.c b/drivers/regulator/bd71837

[PATCH] regulator: bd718x7: Use regulator_map_voltage_ascend for buck5 and buck7

2018-11-09 Thread Axel Lin
The voltages in bd718xx_3rd_nodvs_buck_volts are in ascendant order, so use regulator_map_voltage_ascend. Signed-off-by: Axel Lin --- drivers/regulator/bd718x7-regulator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7

[PATCH 2/2] regulator: bd71837: Simplify bd71837_set_voltage_sel_restricted implementation

2018-06-27 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/bd71837-regulator.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/bd71837-regulator.c b/drivers/regulator/bd71837-regulator.c index 403b45de1262..f57f42ed7160 100644 --- a/drivers/regulator

[PATCH 1/2] regulator: bd71837: Staticize ldo_2_volts

2018-06-27 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/bd71837-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/bd71837-regulator.c b/drivers/regulator/bd71837-regulator.c index 6eae4d0432a2..403b45de1262 100644 --- a/drivers/regulator/bd71837-regulator.c

[PATCH] regulator: mcp16502: Fix missing n_voltages setting

2018-12-19 Thread Axel Lin
The n_voltages setting is not set, fix it. Signed-off-by: Axel Lin --- drivers/regulator/mcp16502.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/mcp16502.c b/drivers/regulator/mcp16502.c index 25d7b433fafd..ec5b6836a20c 100644 --- a/drivers/regulator/mcp16502.c +++ b

[PATCH] regulator: mcp16502: Fix build error when !CONFIG_SUSPEND && CONFIG_PM_SLEEP

2018-12-20 Thread Axel Lin
‘mcp16502_suspend_noirq’? mcp16502_resume_noirq) ^ ./include/linux/pm.h:343:18: note: in definition of macro ‘SET_NOIRQ_SYSTEM_SLEEP_PM_OPS’ .resume_noirq = resume_fn, \ ^ Signed-off-by: Axel Lin --- drivers/regulator/mcp16502.c | 7 ++- 1 file

[PATCH] regulator: mcp16502: Use #ifdef CONFIG_PM_SLEEP around mcp16502_suspend/resume_noirq

2018-12-20 Thread Axel Lin
mcp16502_suspend/resume_noirq is only used by SET_NOIRQ_SYSTEM_SLEEP_PM_OPS when CONFIG_PM_SLEEP is defined. So use #ifdef CONFIG_PM_SLEEP instead CONFIG_SUSPEND guard. Signed-off-by: Axel Lin --- This patch replaces below patch I sent today. regulator: mcp16502: Fix build error when

[PATCH] regulator: mcp16502: Select REGMAP_I2C to fix build error

2018-12-20 Thread Axel Lin
Fix build error when CONFIG_REGMAP_I2C=m && CONFIG_REGULATOR_MCP16502=y. drivers/regulator/mcp16502.o: In function `mcp16502_probe': mcp16502.c:(.text+0xca): undefined reference to `__devm_regmap_init_i2c' Signed-off-by: Axel Lin --- drivers/regulator/Kconfig | 1 + 1 file ch

[RFT][PATCH] regulator: bcm590xx: Fix .enable_reg for BCM590XX_REG_VSR

2019-01-04 Thread Axel Lin
Current implementation missed the case BCM590XX_REG_VSR, so bcm590xx_get_enable_register() returns 0 when id is BCM590XX_REG_VSR. Signed-off-by: Axel Lin --- Hi Matt, Current code looks strange becasue bcm590xx_get_enable_register() returns 0 for BCM590XX_REG_VSR but there is a

[PATCH] regulator: act8945a: Use rdev_get_id() to access id of regulator

2019-01-04 Thread Axel Lin
Use rdev_get_id() instead of directly access rdev->desc->id. Signed-off-by: Axel Lin --- drivers/regulator/act8945a-regulator.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/act8945a-regulator.c b/drivers/regulator/act8945a-regulator.c

[PATCH] regulator: lochnagar: Set up correct .data field for "cirrus,lochnagar2-mic2vdd"

2018-12-29 Thread Axel Lin
Fix trival copy-n-paste mistake. Signed-off-by: Axel Lin --- drivers/regulator/lochnagar-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/lochnagar-regulator.c b/drivers/regulator/lochnagar-regulator.c index 5a89e6d4b9a6..818d20410518 100644

[PATCH] regulator: stpmic1: Return REGULATOR_MODE_INVALID for invalid mode

2018-10-09 Thread Axel Lin
-EINVAL is not a valid return value for .of_map_mode, return REGULATOR_MODE_INVALID instead. Signed-off-by: Axel Lin --- drivers/regulator/stpmic1_regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/stpmic1_regulator.c b/drivers/regulator

[PATCH v3] regulator: bd718x7: Remove struct bd718xx_pmic

2018-10-03 Thread Axel Lin
All the fields in struct bd718xx_pmic are not really necessary. Remove struct bd718xx_pmic to simplify the code. Signed-off-by: Axel Lin Reviewed-by: Matti Vaittinen --- v3: Remove the references to struct bd718xx_pmic from include/linux/mfd/rohm-bd718x7.h drivers/regulator/bd718x7

[PATCH v4] regulator: bd718x7: Remove struct bd718xx_pmic

2018-10-04 Thread Axel Lin
All the fields in struct bd718xx_pmic are not really necessary. Remove struct bd718xx_pmic to simplify the code. Signed-off-by: Axel Lin Reviewed-by: Matti Vaittinen --- v4: Drop the pointer to struct bd718xx_pmic inside the struct bd718xx v3: Remove the references to struct bd718xx_pmic from

[PATCH] regulator: stpmic1: Remove explicitly enable_val and disable_val settings

2018-11-02 Thread Axel Lin
When enable_val is the same as enable_mask and disable_val is 0, the regulator core will use enable_mask as enable_val by default. So don't need to explicitly set enable_val and disable_val. Signed-off-by: Axel Lin --- drivers/regulator/stpmic1_regulator.c | 17 + 1 file ch

[PATCH] regulator: mt6315: Return REGULATOR_MODE_INVALID for invalid mode

2021-02-14 Thread Axel Lin
-EINVAL is not a valid return value for .of_map_mode, return REGULATOR_MODE_INVALID instead. Signed-off-by: Axel Lin --- drivers/regulator/mt6315-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/mt6315-regulator.c b/drivers/regulator/mt6315

[PATCH] regulator: pf8x00: Use regulator_map_voltage_ascend for pf8x00_buck7_ops

2021-02-15 Thread Axel Lin
The voltages in pf8x00_sw7_voltages are in ascendant order, so use regulator_map_voltage_ascend. Signed-off-by: Axel Lin --- drivers/regulator/pf8x00-regulator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/pf8x00-regulator.c b/drivers/regulator/pf8x00-regulator.c

[PATCH] regulator: qcom_rpm: Don't update vreg->uV/mV if rpm_reg_write fails

2015-01-23 Thread Axel Lin
Ensure get_voltage return correct voltage if set_voltage fails. Signed-off-by: Axel Lin --- drivers/regulator/qcom_rpm-regulator.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c

[PATCH] regulator: Fix documentation for regmap in the config

2015-01-24 Thread Axel Lin
Signed-off-by: Axel Lin --- include/linux/regulator/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index d4ad5b5..045f709 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator

[PATCH] regulator: lp872x: Remove **regulators from struct lp872x

2015-01-25 Thread Axel Lin
Current code is using devm_regulator_register(), so we don't need to store *rdev in struct lp872x for clean up. Also clean up lp872x_probe() a bit to remove unnecessary goto and num_regulators variable. Signed-off-by: Axel Lin --- drivers/regulator/lp872x.c | 24 +--- 1

[PATCH] regulator: stw481x: Remove unused fields from struct stw481x

2015-03-19 Thread Axel Lin
The mutex lock is not used at all, remove it. The *vmmc_regulator is not necessary, use a local variable in stw481x_vmmc_regulator_probe() instead. Signed-off-by: Axel Lin Reviewed-by: Linus Walleij Acked-by: Lee Jones --- Change the prefix from mfd to regulator. drivers/regulator/stw481x

[PATCH] phy: qcom-ufs: Fix build error due to missing export symbols

2015-03-22 Thread Axel Lin
vers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined! ERROR: "ufs_qcom_phy_remove" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined! ERROR: "get_ufs_qcom_phy" [drivers/phy/phy-qcom-ufs-qmp-14nm.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 Signed-off-by: A

[PATCH] phy: qcom-ufs: Don't return error if fail to get optional resource

2015-03-22 Thread Axel Lin
"dev_ref_clk_ctrl_mem" is optional resource, so don't return error if fail to get the resource. Since it's an optional resource, don't emit error if fail to get dev_ref_clk_ctrl_mem. Also remove redundant test for res, it's done by devm_ioremap_resource(). Signed-

[PATCH] phy: core: Check requested PHY status in _of_phy_get()

2015-04-06 Thread Axel Lin
This is a common checking in various drivers, so move the checking to _of_phy_get(). Signed-off-by: Axel Lin --- drivers/phy/phy-core.c | 6 ++ drivers/phy/phy-miphy28lp.c | 5 - drivers/phy/phy-miphy365x.c | 5 - drivers/phy/phy-rcar-gen2.c | 5 - 4 files changed, 6

[PATCH v2] phy: core: Check requested PHY status in _of_phy_get()

2015-04-06 Thread Axel Lin
This is a common checking in various drivers, so move the checking to _of_phy_get(). Signed-off-by: Axel Lin --- v2: Fixup the error patch. It needs to call module_put if Requested PHY is disabled. drivers/phy/phy-core.c | 12 ++-- drivers/phy/phy-miphy28lp.c | 5

[PATCH v2 1/2] phy: spear1310-miphy: Return proper error for spear1310_miphy_xlate

2015-03-31 Thread Axel Lin
The of_xlate callback should return ERR_PTR on error. Signed-off-by: Axel Lin --- v2: Return -ENODEV instead of -EINVAL so that phy_optional_get() doesn't fail. drivers/phy/phy-spear1310-miphy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-spea

[PATCH v2 2/2] phy: spear1340-miphy: Return proper error for spear1340_miphy_xlate

2015-03-31 Thread Axel Lin
The of_xlate callback should return ERR_PTR on error. Signed-off-by: Axel Lin --- v2: Return -ENODEV instead of -EINVAL so that phy_optional_get() doesn't fail. drivers/phy/phy-spear1340-miphy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-spea

[PATCH] phy: core: Fix error checking in (devm_)phy_optional_get

2015-04-07 Thread Axel Lin
Don't pass valid pointer to PTR_ERR, use PTR_ERR(phy) only when IS_ERR(phy) is true. Signed-off-by: Axel Lin --- drivers/phy/phy-core.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 3791838f..f112fff 1

[PATCH v2] phy: core: Fix error checking in (devm_)phy_optional_get

2015-04-07 Thread Axel Lin
Don't pass valid pointer to PTR_ERR, use PTR_ERR(phy) only when IS_ERR(phy) is true. Signed-off-by: Axel Lin --- drivers/phy/phy-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 3791838f..63bc12d 100644

Re: [PATCH] phy: core: Fix error checking in (devm_)phy_optional_get

2015-04-07 Thread Axel Lin
2015-04-07 22:21 GMT+08:00 Kishon Vijay Abraham I : > Hi, > > On Tuesday 07 April 2015 05:13 PM, Axel Lin wrote: >> >> Don't pass valid pointer to PTR_ERR, use PTR_ERR(phy) only when >> IS_ERR(phy) is true. >> >> Signed-off-by: Axel Lin >> --- &g

Re: [PATCH 3.4 115/176] spi: dw: Fix detecting FIFO depth

2015-04-09 Thread Axel Lin
2015-04-09 16:46 GMT+08:00 : > From: Axel Lin > > 3.4.107-rc1 review patch. If anyone has any objections, please let me know. > > -- > > > commit d297933cc7fcfbaaf2d37570baac73287bf0357d upstream. > > Current code tries to find the highest valid fi

[PATCH RFC] regulator: mc13xxx: Populate selector from mc13xxx_fixed_regulator_set_voltage

2012-07-13 Thread Axel Lin
This was missing until now and the underlying _regulator_do_set_voltage is using this value when calling list_voltage. Signed-off-by: Axel Lin --- Not very sure if we should implement set_voltage callback for fixed voltage. ( Other drivers do not implement set_voltage callback for fixed voltage

[PATCH RFT 1/2] regulator: twl: Fix checking voltage range in twl6030smps_set_voltage()

2012-07-13 Thread Axel Lin
cases to ensure the selected voltage still in bounds. Signed-off-by: Axel Lin --- drivers/regulator/twl-regulator.c | 36 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c inde

[PATCH RFT 2/2] regulator: twl: Convert twlsmps_ops to get_voltage_sel and map_voltage

2012-07-13 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/twl-regulator.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index 03d0bea..8dae1e3 100644 --- a/drivers/regulator/twl

[PATCH] regulator: lp872x: Simplify implementation of lp872x_find_regulator_init_data()

2012-07-15 Thread Axel Lin
Pass regulator id rahter than the index to lp872x_find_regulator_init_data(), then the code can be simpler. We can also get max_regulators by lp->num_regulators. Signed-off-by: Axel Lin --- drivers/regulator/lp872x.c | 28 +++- 1 file changed, 7 insertions(+),

Re: [PATCH RFT 1/2] regulator: twl: Fix the formula to calculate vsel and voltage for twl6030ldo

2012-07-16 Thread Axel Lin
> On Monday 09 July 2012 04:31 PM, Axel Lin wrote: > > 於 一,2012-07-09 於 11:22 +0800,Axel Lin 提到: > >> In twl6030ldo_set_voltage, current code use below formula to calculate > >> vsel: > >> vsel = (min_uV/1000 - 1000)/100 + 1; > >> This is wor

[PATCH RFT] regulator: twl: Fix list_voltate for twl6030ldo_ops

2012-07-16 Thread Axel Lin
This patch implements the list_voltage callback based on above table. Signed-off-by: Axel Lin --- drivers/regulator/twl-regulator.c | 31 --- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl

[PATCH] regulator: anatop: Fix wrong mask used in anatop_get_voltage_sel

2012-07-16 Thread Axel Lin
The mask used in anatop_get_voltage_sel does not match the mask used in anatop_set_voltage_sel. We need to do left shift anatop_reg->vol_bit_shift bits for the correct mask. Signed-off-by: Axel Lin --- drivers/regulator/anatop-regulator.c |5 +++-- 1 file changed, 3 insertions(+)

[PATCH RFT] regulator: palmas: Fix calcuating selector in palmas_map_voltage_smps

2012-07-16 Thread Axel Lin
ake into account with the multiplier set in VSEL register when calculating selector in palmas_map_voltage_smps() Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/pal

[PATCH RFT] regulator: s2mps11: Fix ramp_delay settings for s2mps11_buck_ops

2012-07-16 Thread Axel Lin
The ramp_delay settings were missing while converting to regulator_set_voltage_time_sel(). Fix it. There is no ramp_delay setting for s2mps11_ldo_ops, thus remove setting set_voltage_sel callback for s2mps11_ldo_ops. Signed-off-by: Axel Lin --- drivers/regulator/s2mps11.c | 27

[PATCH] regulator: palmas: Fix calculating selector in palmas_map_voltage_ldo

2012-07-17 Thread Axel Lin
han requested min_uV. For example, if the requested min_uV is 945000, current code chooses selector = 1 which is lower than requested min_uV. DIV_ROUND_UP to avoid this case. Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c |9 ++--- 1 file changed, 6 insertions(+)

[PATCH RFT 1/2] regulator: palmas: Fix regmap offsets for PALMAS_REG_SMPS10 vsel_reg

2012-07-17 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 0fcf355..9e3e7f3 100644 --- a/drivers/regulator/palmas-regulator.c +++ b

[PATCH RFT 2/2] regulator: palmas: Convert palmas_ops_ldo to [get|set]_voltage_sel_regmap

2012-07-17 Thread Axel Lin
Also remove palmas_ldo_write() function because it is not used after this conversion. Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c | 55 -- 1 file changed, 5 insertions(+), 50 deletions(-) diff --git a/drivers/regulator/palmas-regulator.c

Re: [PATCH RFT 2/2] regulator: palmas: Convert palmas_ops_ldo to [get|set]_voltage_sel_regmap

2012-07-17 Thread Axel Lin
於 三,2012-07-18 於 11:49 +0800,Axel Lin 提到: > Also remove palmas_ldo_write() function because it is not used after this > conversion. Oh. Just found another issue in current code. Current code in palmas_ldo_init() calls palmas_smps_[read|write] is wrong. It should call palmas_ldo_[read

[RFT][PATCH 1/5] regulator: palmas: Fix calculating selector in palmas_map_voltage_ldo

2012-07-17 Thread Axel Lin
han requested min_uV. For example, if the requested min_uV is 945000, current code chooses selector = 1 which is lower than requested min_uV. DIV_ROUND_UP to avoid this case. Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c |9 ++--- 1 file changed, 6 insertions(+)

[RFT][PATCH 2/5] regulator: palmas: Fix regmap offsets for PALMAS_REG_SMPS10 vsel_reg

2012-07-17 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 0fcf355..9e3e7f3 100644 --- a/drivers/regulator/palmas-regulator.c +++ b

[RFT][PATCH 3/5] regulator: palmas: Call palmas_ldo_[read|write] in palmas_ldo_init

2012-07-17 Thread Axel Lin
Current code uses wrong calls palmas_smps_[read|write] in palmas_ldo_init(), should be palmas_ldo_[read|write] instead. Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/palmas

[RFT][PATCH 4/5] regulator: palmas: Fix palmas_probe error handling

2012-07-17 Thread Axel Lin
registered in this for loop iteration. Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index de68347..46c7e88 100644 --- a/drivers

[RFT][PATCH v2 5/5] regulator: palmas: Convert palmas_ops_ldo to [get|set]_voltage_sel_regmap

2012-07-17 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c | 45 -- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 46c7e88..2ba7502 100644 --- a/drivers

[PATCH 1/2] regulator: mc13783: Make mc13783_powermisc_rmw() lock protected

2012-07-18 Thread Axel Lin
Then we can remove lock/unlock around the caller. Signed-off-by: Axel Lin --- drivers/regulator/mc13783-regulator.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c index

[PATCH 2/2] regulator: mc13892: Make mc13892_powermisc_rmw() lock protected

2012-07-18 Thread Axel Lin
Then we can remove lock/unlock around the caller. Signed-off-by: Axel Lin --- drivers/regulator/mc13892-regulator.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c index

[PATCH RFT 1/2] regulator: mc13892: Simplify implementation of mc13892_sw_regulator_set_voltage_sel()

2012-07-19 Thread Axel Lin
leave MC13892_SWITCHERS0_SWxHI bit untouched We already know the selector, so we don't need to calculate the selector again. Signed-off-by: Axel Lin --- drivers/regulator/mc13892-regulator.c | 42 - 1 file changed, 15 insertions(+), 27 deletions(-) d

<    2   3   4   5   6   7   8   9   10   11   >