[PATCH] of/irq: Avoid calling list_first_entry() for empty list

2013-06-23 Thread Axel Lin
list_first_entry() expects the list is not empty, we need to check if list is empty before calling list_first_entry(). Thus use list_first_entry_or_null() instead of list_first_entry(). Signed-off-by: Axel Lin --- drivers/of/irq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH] irqchip: vt8500: Staticize local symbols

2013-07-03 Thread Axel Lin
This driver is converted to use IRQCHIP_DECLARE and irqchip_init. vt8500_handle_irq() and vt8500_irq_init() are only referenced in this file now, make them static. Signed-off-by: Axel Lin --- drivers/irqchip/irq-vt8500.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a

irqchip: sirfsoc: Question about SIRFSOC_NUM_IRQS setting

2013-07-04 Thread Axel Lin
irq_setup_generic_chip() setup max. 32 interrupts starting from gc->irq_base. sirfsoc_irq_init() -> sirfsoc_alloc_gc() -> irq_setup_generic_chip() In sirfsoc_irq_init(), current code calls sirfsoc_alloc_gc(base + 4, 32, SIRFSOC_NUM_IRQS - 32); //Note, SIRFSOC_NUM_IRQS is 128 So I'm wonder

[PATCH v2] irqchip: vt8500: Staticize local symbols

2013-07-04 Thread Axel Lin
This driver is converted to use IRQCHIP_DECLARE and irqchip_init. vt8500_handle_irq() and vt8500_irq_init() are only referenced in this file, so make them static. Signed-off-by: Axel Lin Acked-by: Tony Prisk --- drivers/irqchip/irq-vt8500.c | 6 -- 1 file changed, 4 insertions(+), 2

[PATCH] irqchip: sun4i: Staticize sun4i_irq_ack()

2013-07-05 Thread Axel Lin
sun4i_irq_ack() is only referenced in this file, so make it static. Signed-off-by: Axel Lin --- drivers/irqchip/irq-sun4i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-sun4i.c b/drivers/irqchip/irq-sun4i.c index b66d4ae..a5438d8 100644 --- a/drivers

[PATCH RFC] genirq: Genric chip: Use DIV_ROUND_UP to count numchips

2013-07-05 Thread Axel Lin
The number of interrupts in a domain may be not divisible by the number of interrupts each chip handles. Integer division may truncate the result, thus use DIV_ROUND_UP to count numchips. Signed-off-by: Axel Lin --- Seems all users of irq_alloc_domain_generic_chips() in current code do not have

[PATCH RFT] irqchip: sun4i: Remove wrong irq_ack callback implementation

2013-07-06 Thread Axel Lin
sun4i_of_init(). [1] http://dl.linux-sunxi.org/A10/A10%20User%20Manual%20-%20v1.20%20%282012-04-09%2c%20DECRYPTED%29.pdf Signed-off-by: Axel Lin --- Hi Maxime, I don't have this hardware, I'd appreciate if you can test this patch. If this patch works, I think we can just drop t

[PATCH] pinctrl: st: Fix checking return value of syscon_regmap_lookup_by_phandle()

2013-06-28 Thread Axel Lin
syscon_regmap_lookup_by_phandle() returns ERR_PTR on error. Signed-off-by: Axel Lin --- drivers/pinctrl/pinctrl-st.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 7effedf..f95c82a 100644 --- a/drivers

Re: [PATCH] pinctrl: st: Fix checking return value of syscon_regmap_lookup_by_phandle()

2013-06-28 Thread Axel Lin
2013/6/28 Srinivas KANDAGATLA : > Thankyou Axel for looking at this. > > There is already a patch is submitted for this. > https://lkml.org/lkml/2013/6/26/494 which I have Acked. That is strange. I don't think the patch you mentioned can be applied to current pinctrl tree. Current code does check

[PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register

2013-06-28 Thread Axel Lin
Signed-off-by: Axel Lin --- Hi, Seems current code also needs this patch: mfd: 88pm800: add regulator sub device [1] Otherwise, I got build error: CC drivers/regulator/88pm800.o drivers/regulator/88pm800.c: In function 'pm800_regulator_probe': drivers/regulator/88pm80

[PATCH 2/2] regulator: 88pm800: Remove NULL test for regulator_unregister()

2013-06-28 Thread Axel Lin
It's safe to call regulator_unregister with NULL. In additional, having NULL check in the for loop is wrong because the for loop exits if pm800_data->regulators[i] is NULL. So we have have some regulators remains registered. Signed-off-by: Axel Lin --- drivers/regulator/88pm800.c | 4

regulator: Is there any reason the 88PM800 regulator driver can not be built as module?

2013-06-28 Thread Axel Lin
Hi, I ask this because MFD_88PM800 can be built as module. So any reason REGULATOR_88PM800 must be bool? Regards, Axel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/ma

Re: [PATCH] pinctrl: st: Fix checking return value of syscon_regmap_lookup_by_phandle()

2013-06-28 Thread Axel Lin
2013/6/28 Srinivas KANDAGATLA : > On 28/06/13 13:16, Axel Lin wrote: >> 2013/6/28 Srinivas KANDAGATLA : >>> Thankyou Axel for looking at this. >>> >>> There is already a patch is submitted for this. >>> https://lkml.org/lkml/2013/6/26/494 which I have A

[PATCH] pinctrl: st: Remove unnecessary use of of_match_ptr macro

2013-06-28 Thread Axel Lin
This is a DT only driver and st_pctl_of_match is always compiled in. Hence of_match_ptr is unnecessary. Signed-off-by: Axel Lin --- drivers/pinctrl/pinctrl-st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index

[PATCH] palmas: Simplify regulator_desc setting for SMPS10_[OUT1|OUT2]

2013-06-28 Thread Axel Lin
The regulator_desc setting for SMPS10-OUT1 and SMPS10-OUT2 are very similar, only enable_mask is different. Make the switch case fall through to simplify the code. Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c | 22 -- 1 file changed, 4 insertions(+), 18

[PATCH] regulator: max77693: Fix trivial typo

2013-06-28 Thread Axel Lin
Fix trivial typo in the equation to check upper bound of current setting. Signed-off-by: Axel Lin --- drivers/regulator/max77693.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/max77693.c b/drivers/regulator/max77693.c index 674ece7..d45a4dd 100644 --- a

[PATCH] regulator: max77693: Skip register regulator if no platform initialization data

2013-06-28 Thread Axel Lin
[]). Signed-off-by: Axel Lin --- drivers/regulator/max77693.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/regulator/max77693.c b/drivers/regulator/max77693.c index d45a4dd..6116a49 100644 --- a/drivers/regulator/max77693.c +++ b/drivers/regulator/max77693.c @@ -265,6 +265,9

[PATCH] regulator: max77693: Remove NULL test for rmatch[i].init_data

2013-06-29 Thread Axel Lin
terate "matched" times rather than ARRAY_SIZE(regulators) because we only allocate "matched" number of entries for rdata. Though in most cases, "matched" == ARRAY_SIZE(regulators). Signed-off-by: Axel Lin --- drivers/regulator/max77693.c | 4 +--- 1 file changed, 1 insert

[PATCH] pinctrl: st: Remove unnecessary use of of_match_ptr macro

2013-06-29 Thread Axel Lin
This is a DT only driver and st_pctl_of_match is always compiled in. Hence of_match_ptr is unnecessary. Signed-off-by: Axel Lin Acked-by: Linus Walleij --- This patch was sent on https://lkml.org/lkml/2013/6/28/420. Resend to Mark because this driver is merged via regmap tree. drivers/pinctrl

Re: [linux-next] Not able to fetch next-20130321

2013-03-22 Thread Axel Lin
2013/3/22 Stephen Rothwell : > Hi Axel, > > On Thu, 21 Mar 2013 22:50:18 +0800 Axel Lin wrote: >> >> I run "git remote update" but cannot find next-20130321 tag. >> It seems the latest tag is "next-20130318". >> https://git.kernel.org/cgit/

Re: [linux-next] Not able to fetch next-20130321

2013-03-22 Thread Axel Lin
2013/3/22 Stephen Rothwell : > Hi Axel, > > On Fri, 22 Mar 2013 16:51:40 +0800 Axel Lin wrote: >> >> Even with a fresh git clone, it still shows the latest commit is 20130318. >> >> $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git >

[PATCH] clocksource: exynos_mct: Add terminating entry for exynos_mct_ids table

2013-03-23 Thread Axel Lin
The of_device_id table is supposed to be zero-terminated. Signed-off-by: Axel Lin --- drivers/clocksource/exynos_mct.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 203ac05..3cdafc0 100644 --- a/drivers

Re: [PATCH] clocksource: exynos_mct: Add terminating entry for exynos_mct_ids table

2013-03-24 Thread Axel Lin
2013/3/25 Kukjin Kim : > Axel Lin wrote: >> >> The of_device_id table is supposed to be zero-terminated. >> >> Signed-off-by: Axel Lin >> --- >> drivers/clocksource/exynos_mct.c |1 + >> 1 file changed, 1 insertion(+) >> >> d

[PATCH 1/2] regulator: ab8500: Fix build error

2013-03-24 Thread Axel Lin
ing: assignment from incompatible pointer type [enabled by default] make[2]: *** [drivers/regulator/ab8500.o] Error 1 make[1]: *** [drivers/regulator] Error 2 make: *** [drivers] Error 2 Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c | 10 +- 1 file changed, 5 insertions(+), 5 dele

[PATCH 2/2] regulator: ab8500: Use regulator_list_voltage_linear for fixed voltage

2013-03-24 Thread Axel Lin
ab8500_regulator_mode_ops. It is used only for fixed voltage, so it does not need to implement set_voltage_time_sel. Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator

[PATCH] regulator: maintainers: Update email address for Liam

2013-03-25 Thread Axel Lin
Liam sent a patch[1] to update his email, but it only updates the maintainer entry for ASoC. This patch updates the entry for regulator subsystem to ensure get_maintainer.pl returns correct email address for maintainers. [1] https://lkml.org/lkml/2013/1/15/344 Signed-off-by: Axel Lin

[PATCH] clocksource: Fix build error when !CONFIG_CLKSRC_OF

2013-03-25 Thread Axel Lin
ed '=', ',', ';', 'asm' or '__attribute__' before '__unused' make[2]: *** [drivers/clocksource/exynos_mct.o] Error 1 make[1]: *** [drivers/clocksource] Error 2 make: *** [drivers] Error 2 This build error is introduced by commit 4d10f054

[PATCH RFC/RFT] regulator: ab8500: Remove is_enabled from struct ab8500_regulator_info

2013-03-25 Thread Axel Lin
lso removes info->is_enabled checking in ab8500_regulator_set_mode(), so it allows setting mode even the regulator is disabled. Signed-off-by: Axel Lin --- Hi, This patch also removes info->is_enabled checking in ab8500_regulator_set_mode(). I'm not very clear if we should avoid setting

Re: [PATCH RFC/RFT] regulator: ab8500: Remove is_enabled from struct ab8500_regulator_info

2013-03-26 Thread Axel Lin
2013/3/26 Bengt Jönsson : > On 03/26/2013 07:50 AM, Axel Lin wrote: >> >> The is_enabled flag looks not necessary at all, it also introduces some >> issues >> because current code updates info->is_enabled flag in error paths of >> ab8500_regulator_enable() and

[PATCH] regulator: ab8500: Don't update is_enabled flag in error paths

2013-03-26 Thread Axel Lin
This avoid setting is_enabled flag to wrong status if enable/disable fails. Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index 12e2740..5e7e84b 100644

[PATCH v2] regulator: ab8500: Don't update is_enabled flag in error paths

2013-03-26 Thread Axel Lin
This avoid setting is_enabled flag to wrong status if enable/disable fails. Signed-off-by: Axel Lin --- v2: Just make the coding style consist with rest of the code. drivers/regulator/ab8500.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/regulator

[PATCH] pwm: ab8500: Fix trivial typo in dev_err message

2013-03-26 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/pwm/pwm-ab8500.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-ab8500.c b/drivers/pwm/pwm-ab8500.c index 93af1bb..3beb2b5 100644 --- a/drivers/pwm/pwm-ab8500.c +++ b/drivers/pwm/pwm-ab8500.c @@ -66,7 +66,7 @@ static int

[PATCH 1/2] pwm: tiecap: Staticize non-exported symbols

2013-03-26 Thread Axel Lin
Both ecap_pwm_save_context() and ecap_pwm_restore_context() are only used in this file, make them static. Signed-off-by: Axel Lin --- drivers/pwm/pwm-tiecap.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pwm/pwm-tiecap.c b/drivers/pwm/pwm-tiecap.c index

[PATCH 2/2] pwm: tiehrpwm: Staticize non-exported symbols

2013-03-26 Thread Axel Lin
Both ehrpwm_pwm_save_context() and ehrpwm_pwm_restore_context() are only used in this file, make them static. Signed-off-by: Axel Lin --- drivers/pwm/pwm-tiehrpwm.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c

Re: [patch] regulator: 88pm800: forever loop in pm800_regulator_probe()

2013-08-14 Thread Axel Lin
*/ > - for (i = 0; ARRAY_SIZE(pdata->regulators); i++) { > + for (i = 0; i < ARRAY_SIZE(pdata->regulators); i++) { > if (pdata->regulators[i]) > count++; > } Oops. My bad. Thanks for the fi

[PATCH 1/2] pinctrl: core: Hold pinctrldev_list_mutex mutex while traversing pinctrldev_list

2013-08-18 Thread Axel Lin
This one is missed in commit 44d5f7bb "pinctrl: sink pinctrldev_list_mutex". Signed-off-by: Axel Lin --- drivers/pinctrl/core.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index c8fcedb..c670527 100644 --- a/drivers/pinc

[PATCH 2/2] pinctrl: core: Hold pctldev->mutex mutex lock while traversing gpio_ranges list

2013-08-18 Thread Axel Lin
Hold pctldev->mutex mutex_lock when traverse the list. Signed-off-by: Axel Lin --- drivers/pinctrl/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index c670527..4adef2f 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinc

[PATCH] Documentation: pinctrl: Fix example code for pinctrl_register

2013-08-18 Thread Axel Lin
pinctrl_register() returns NULL on error, fix it. Signed-off-by: Axel Lin --- Documentation/pinctrl.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt index e7bee9b..c0ffd30 100644 --- a/Documentation/pinctrl.txt +++ b

[PATCH 1/2] pinctrl: core: Remove unnecessary test for desc->name

2013-08-18 Thread Axel Lin
The implementation in pinctrl_register_one_pin() ensures pindesc->name is always not NULL before insert the pindesc to radix tree. If the desc return from pin_desc_get is not NULL, desc->name is always not NULL. Signed-off-by: Axel Lin --- drivers/pinctrl/core.c | 4 +--- 1 file chan

[PATCH 2/2] pinctrl: core: Add proper mutex lock in pinctrl_request_gpio

2013-08-18 Thread Axel Lin
This one is missed in commit 42fed7ba "pinctrl: move subsystem mutex to pinctrl_dev struct". Signed-off-by: Axel Lin --- drivers/pinctrl/core.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 53c40d9..92f86ab 100644 ---

[PATCH RFT] regulator: da903x: Convert da9034 ldo12 to use linear ranges

2013-07-15 Thread Axel Lin
for selector 8 ... 15: volt = 270 + 5 * (selector - 8) This patch converts da9034 LDO12 to use newly introduced helpers for multiple linear ranges. Signed-off-by: Axel Lin --- drivers/regulator/da903x.c | 45 ++--- 1 file changed, 10

[PATCH RFT] regulator: as3711: Convert to use linear ranges

2013-07-16 Thread Axel Lin
5mV 71h-7Fh: Volt = 2.650V + (sdx_vsel - 71h) * 50mV Signed-off-by: Axel Lin --- drivers/regulator/as3711-regulator.c | 163 +++ 1 file changed, 31 insertions(+), 132 deletions(-) diff --git a/drivers/regulator/as3711-regulator.c b/drivers/regulator/as3711-regulato

[PATCH RESEND] regulator: da903x: Convert da9034 ldo12 to use linear ranges

2013-07-28 Thread Axel Lin
for selector: 8 ... 15: volt = 270 + 5 * (selector - 8) This patch converts da9034 LDO12 to use newly introduced helpers for multiple linear ranges. Signed-off-by: Axel Lin --- hi Mark, This patch was sent on https://lkml.org/lkml/2013/7/15/678 and you replied applied. However, I

[PATCH 1/2] regulator: pfuze100: REGULATOR_PFUZE100 needs to select REGMAP_I2C

2013-07-28 Thread Axel Lin
rs make[2]: *** [drivers/regulator/pfuze100-regulator.o] Error 1 make[1]: *** [drivers/regulator] Error 2 make: *** [drivers] Error 2 Signed-off-by: Axel Lin --- drivers/regulator/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig

[PATCH 2/2] regulator: pfuze100: Use i2c_[set|get]_clientdata

2013-07-28 Thread Axel Lin
Since this is a i2c driver, use i2c_[set|get]_clientdata instead of dev_[set|get]_drvdata. Signed-off-by: Axel Lin --- drivers/regulator/pfuze100-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator

[PATCH] regulator: pfuze100: Fix module alias prefix

2013-07-28 Thread Axel Lin
i2c drivers use "i2c:" prefix for module alias. Signed-off-by: Axel Lin --- drivers/regulator/pfuze100-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c index cd136ff..e9e8

regulator: pfuze100: A few small questions

2013-07-29 Thread Axel Lin
Hi Robin, 2 questions about the code in pfuze100 driver: 1) Both PFUZE100_REVID and PFUZE100_FABID are defined as 0x3. So I'm wondering if it's a typo in one of the register address? If they are actually the same register, we don't need to read the same register twice in pfuze_identify(). 2) What

[PATCH] regulator: pfuze100: Use regulator_map_voltage_ascend

2013-07-29 Thread Axel Lin
All table based voltage list have ascendant order. Use regulator_map_voltage_ascend for them. Signed-off-by: Axel Lin --- drivers/regulator/pfuze100-regulator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c

Re: regulator: pfuze100: A few small questions

2013-07-29 Thread Axel Lin
2013/7/29 Axel Lin : > Hi Robin, > 2 questions about the code in pfuze100 driver: > > 1) > Both PFUZE100_REVID and PFUZE100_FABID are defined as 0x3. > So I'm wondering if it's a typo in one of the register address? > If they are actually the same register,

Re: regulator: pfuze100: A few small questions

2013-07-29 Thread Axel Lin
>> Current code adjust min_uV and uV_step when SW2~SW4 high bit is set. >> I'm wondering if n_voltages is correct or not in this case because >> the n_voltages is calculated by original equation (max-min/step + 1). >> What is the max_uV when SW2~SW4 high bit is set? >> > If high bit set(bit6, bit0~

Re: regulator: pfuze100: A few small questions

2013-07-29 Thread Axel Lin
2013/7/30 Robin Gong : > On Mon, Jul 29, 2013 at 11:44:40PM +0800, Axel Lin wrote: >> >> Current code adjust min_uV and uV_step when SW2~SW4 high bit is set. >> >> I'm wondering if n_voltages is correct or not in this case because >> >> the n_voltages

[PATCH RFT] regulator: pfuze100: Fix n_voltages setting for SW2~SW4 with high bit set

2013-07-29 Thread Axel Lin
selector is in the range of 51 ~ 63. Signed-off-by: Axel Lin --- drivers/regulator/pfuze100-regulator.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c index 2dadc31..a77379b

[PATCH] regulator: pfuze100: Simplify pfuze100_set_ramp_delay implementation

2013-07-30 Thread Axel Lin
sel_reg for applying different equations. Also use rdev->desc->vsel_reg instead of run-time calculate register address. Signed-off-by: Axel Lin --- drivers/regulator/pfuze100-regulator.c | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/r

[PATCH] regulator: pfuze100: Fix off-by-one for max_register setting

2013-08-01 Thread Axel Lin
max_register should be register count - 1. Signed-off-by: Axel Lin --- Hi Robin, I don't have the datasheet, can you check if this patch is correct or not? If PFUZE_NUMREGS really means register count, I think this fix is required. Thanks, Axel drivers/regulator/pfuze100-regulator.c | 2

[PATCH] regulator: s2mps11: Fix wrong arguments for regmap_update_bits() call

2013-08-03 Thread Axel Lin
Current code calls regmap_update_bits() with mask and val arguments swapped. Signed-off-by: Axel Lin --- drivers/regulator/s2mps11.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c index f047d36..89140ae 100644

regulator: s2mps11: Question about the code updating ramp_delay setting

2013-08-03 Thread Axel Lin
Hi Yadwinder, The code updating ramp_delay setting looks wrong to me. Current code: return regmap_update_bits(rdev->regmap, ramp_reg, ramp_val << ramp_shift, 1 << ramp_shift); I'd expect something like below: return regmap_update_bits(rdev->regmap,

[PATCH] regulator: 88pm800: Fix checking whether num_regulator is valid

2013-08-03 Thread Axel Lin
The code to check whether num_regulator is valid is wrong because it should iterate all array entries rather than break from the for loop if pdata->regulators[i] is NULL. Signed-off-by: Axel Lin --- drivers/regulator/88pm800.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) d

[PATCH] regulator: s2mps11: Fix setting ramp_delay

2013-08-04 Thread Axel Lin
Current code has wrong mask and val arguments for updating ramp_delay. Fix it. Also ensure the return value of get_ramp_delay() won't greater than 3 because the mask field for ramp_val only takes 2 bits. Signed-off-by: Axel Lin --- drivers/regulator/s2mps11.c | 8 ++-- 1 file chang

[PATCH] pinctrl: rockchip: Simplify for loop iteration

2013-08-20 Thread Axel Lin
Just return once a match found makes the code simpler and shorter. Signed-off-by: Axel Lin --- drivers/pinctrl/pinctrl-rockchip.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c

Re: [PATCH 2/2] pinctrl: core: Add proper mutex lock in pinctrl_request_gpio

2013-08-21 Thread Axel Lin
2013/8/22 Linus Walleij : > On Mon, Aug 19, 2013 at 4:07 AM, Axel Lin wrote: > >> This one is missed in commit 42fed7ba "pinctrl: move subsystem mutex to >> pinctrl_dev struct". > > I think this was never there. I think it was protected by the global pinctr

[PATCH] pinctrl: palmas: PINCTRL_PALMAS needs to select PINMUX

2013-08-21 Thread Axel Lin
rl/pinctrl-palmas.c:745:2: warning: (near initialization for 'palmas_pinmux_ops') [enabled by default] make[2]: *** [drivers/pinctrl/pinctrl-palmas.o] Error 1 make[1]: *** [drivers/pinctrl] Error 2 make: *** [drivers] Error 2 Signed-off-by: Axel Lin --- drivers/pinctrl/Kconfig | 1 + 1 fi

[PATCH] irqchip: sun4i: Don't write to read-only registers

2013-08-22 Thread Axel Lin
sun4i_of_init(). [1] http://dl.linux-sunxi.org/A10/A10%20User%20Manual%20-%20v1.20%20%282012-04-09%2c%20DECRYPTED%29.pdf Signed-off-by: Axel Lin Acked-by: Maxime Ripard --- Hi Thomas, This patch was sent on https://lkml.org/lkml/2013/7/6/59 with Maxime's Ack. And re-sent on https://lkml.org

[PATCH 1/2] pinctrl: rockchip: Remove of_match_ptr macro for DT only driver

2013-08-22 Thread Axel Lin
This is a DT only driver and rockchip_pinctrl_dt_match is always compiled in. Thus remove of_match_ptr macro. Signed-off-by: Axel Lin --- drivers/pinctrl/pinctrl-rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl

[PATCH 2/2] pinctrl: rockchip: Remove non-reachable break statement

2013-08-22 Thread Axel Lin
The break statement after return is non-reachable, remove them. Signed-off-by: Axel Lin --- drivers/pinctrl/pinctrl-rockchip.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 7eb1249..319a64a 100644 --- a

[PATCH] pinctrl: rockchip: Simplify pin_to_bank equation

2013-08-23 Thread Axel Lin
If (b->pin_base + b->nr_pins - 1) < pin is true, pin >= b->pin_base is always true because b->nr_pins is never less than 0. Thus this patch simplify the equation. Signed-off-by: Axel Lin --- drivers/pinctrl/pinctrl-rockchip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletion

[PATCH] regulator: fan53555: Prevent multiple include of fan53555.h

2013-08-06 Thread Axel Lin
Add define for __FAN53555_H__ to prevent multiple include of the header file. Signed-off-by: Axel Lin --- include/linux/regulator/fan53555.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/regulator/fan53555.h b/include/linux/regulator/fan53555.h index 5c45c85..f13880e 100644

[PATCH] regulator: core: Move list_voltage_{linear,linear_range,table} to helpers.c

2013-08-09 Thread Axel Lin
Move regulator_list_voltage_{linear,linear_range,table} helper functions to helpers.c. Signed-off-by: Axel Lin --- drivers/regulator/core.c| 86 - drivers/regulator/helpers.c | 86 + 2 files changed, 86

[PATCH] regulator: core: Allow fixed voltage range in multiple linear ranges

2013-07-18 Thread Axel Lin
ned-off-by: Axel Lin --- Note: One of the use case is tps65217. The voltage table for tps65217_vsel_to_uv1: 0 ... 24: uV = vsel * 25000 + 90; 25 ... 52: uV = (vsel - 24) * 5 + 150; = (vsel -25) * 5 + 155; 53 ... 55: uV = (vsel - 52) * 10 + 2900

[PATCH 1/2] regulator: 88pm800: Add missing config.of_node setting for regulator register

2013-07-18 Thread Axel Lin
Signed-off-by: Axel Lin --- drivers/regulator/88pm800.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c index a7d962f..fc0c352 100644 --- a/drivers/regulator/88pm800.c +++ b/drivers/regulator/88pm800.c @@ -331,6 +331,7 @@ static int

[PATCH 2/2] regulator: 88pm800: Depend on MFD_88PM800 rather than MFD_88PM800=y

2013-07-18 Thread Axel Lin
This driver can be built as a module, make it depend on MFD_88PM800. Otherwise, we are not able to select this driver when MFD_88PM800=m. Signed-off-by: Axel Lin --- drivers/regulator/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/Kconfig b/drivers

[PATCH] regulator: 88pm800: Add missing n_voltages setting for bucks

2013-07-18 Thread Axel Lin
Some regulator APIs are broken if n_voltages setting is not set. e.g. regulator_count_voltages(), regulator_list_voltage(), and regulator_can_change_voltage() do not work if n_voltages setting is missing. Signed-off-by: Axel Lin --- drivers/regulator/88pm800.c | 14 -- 1 file

[PATCH RESEND] irqchip: sun4i: Remove wrong irq_ack callback implementation

2013-07-19 Thread Axel Lin
sun4i_of_init(). [1] http://dl.linux-sunxi.org/A10/A10%20User%20Manual%20-%20v1.20%20%282012-04-09%2c%20DECRYPTED%29.pdf Signed-off-by: Axel Lin Acked-by: Maxime Ripard --- This patch was sent on https://lkml.org/lkml/2013/7/6/59 This resend rebase it on top of 3.11-rc1. Thanks, Axel drivers

[PATCH RFT] regulator: tps65217: Convert to use linear ranges

2013-07-20 Thread Axel Lin
tory for 3.3-V option ). This conversion does not change any behavior any way. Signed-off-by: Axel Lin --- drivers/regulator/tps65217-regulator.c | 182 +++-- include/linux/mfd/tps65217.h | 19 2 files changed, 37 insertions(+), 164 deletions(-) diff --g

[PATCH RFT] regulator: tps65912: Convert tps65912_ops_ldo to use linear ranges

2013-07-20 Thread Axel Lin
) * 10 + 300; = (vsel - 61) * 10 + 310; This patch converts tps65912_ops_ldo to use multiple linear ranges APIs. Signed-off-by: Axel Lin --- drivers/regulator/tps65912-regulator.c | 39 +- 1 file changed, 19 insertions(+), 20 deletions

[PATCH] regulator: da9210: Remove redundant MODULE_ALIAS

2013-08-09 Thread Axel Lin
The modalias is set by the MODULE_DEVICE_TABLE, thus remove redundant MODULE_ALIAS. Also Fix trivial typo for the author name. Signed-off-by: Axel Lin --- drivers/regulator/da9210-regulator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/regulator/da9210

Re: [PATCH] regulator: da9210: Remove redundant MODULE_ALIAS

2013-08-09 Thread Axel Lin
2013/8/10 Mark Brown : > On Sat, Aug 10, 2013 at 12:25:58AM +0800, Axel Lin wrote: > >> -MODULE_AUTHOR("S Twiss "); >> +MODULE_AUTHOR("Steve Twiss "); > > It's perfectly reasonable for someone to want to be referred to by their > initial, or thei

Re: [PATCH] regulator: da9210: Remove redundant MODULE_ALIAS

2013-08-11 Thread Axel Lin
2013/8/11 Mark Brown : > On Sat, Aug 10, 2013 at 10:13:23AM +0800, Axel Lin wrote: >> 2013/8/10 Mark Brown : >> > On Sat, Aug 10, 2013 at 12:25:58AM +0800, Axel Lin wrote: > >> >> -MODULE_AUTHOR("S Twiss "); >> >> +MODULE_AUTHOR("Steve Tw

[PATCH v2] regulator: da9210: Remove redundant MODULE_ALIAS

2013-08-11 Thread Axel Lin
The modalias is set by the MODULE_DEVICE_TABLE, thus remove redundant MODULE_ALIAS. Signed-off-by: Axel Lin --- drivers/regulator/da9210-regulator.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/regulator/da9210-regulator.c b/drivers/regulator/da9210-regulator.c index bf492bc

[PATCH RFT] pinctrl: single: Fix build error

2013-03-03 Thread Axel Lin
pinctrl-single.c:1441:3: error: assignment of member 'is_generic' in read-only object make[2]: *** [drivers/pinctrl/pinctrl-single.o] Error 1 make[1]: *** [drivers/pinctrl] Error 2 make: *** [drivers] Error 2 Signed-off-by: Axel Lin --- drivers/pinctrl/pinctrl-single.c |6 +++--- 1

Re: [PATCH RFT] pinctrl: single: Fix build error

2013-03-04 Thread Axel Lin
2013/3/4 Haojian Zhuang : > On 4 March 2013 13:47, Axel Lin wrote: >> If pcs->is_pinconf is false, it means does not support pinconf. >> If pcs->is_pinconf is true, is_generic flag is always true. >> >> This patch fixes below build error: >> >&g

[PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable

2013-03-04 Thread Axel Lin
Add enable_is_inverted flag to indicate set enable_mask bits to disable when using regulator_enable_regmap and friends APIs. Signed-off-by: Axel Lin Reviewed-by: Haojian Zhuang --- This patch was sent on https://lkml.org/lkml/2013/2/16/14. This resend is against linux-next tree (20130305

[PATCH RESEND 2/3] regulator: 88pm8607: Use enable_is_inverted flag with regulator_enable_regmap and friends APIs

2013-03-04 Thread Axel Lin
Signed-off-by: Axel Lin Reviewed-by: Haojian Zhuang --- drivers/regulator/88pm8607.c | 36 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index c79ab84..493948a 100644 --- a

[PATCH RESEND 3/3] regulator: max8649: Use enable_is_inverted flag with regulator_enable_regmap and friends APIs

2013-03-04 Thread Axel Lin
Signed-off-by: Axel Lin Reviewed-by: Haojian Zhuang --- drivers/regulator/max8649.c | 39 ++- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c index 3ca1438..fdb67ff 100644 --- a

[PATCH RFT] pinctrl: abx500: Fix checking if pin use AlternateFunction register

2013-03-04 Thread Axel Lin
It's pointless to check "af.alt_bit1 == UNUSED" twice. This looks like a copy-paste bug, I think what we want is to check if *both* af.alt_bit1 and af.alt_bit2 are UNUSED. Signed-off-by: Axel Lin --- Hi, I don't have the datasheet and hw. I'd appreciate if someone can r

Re: [PATCH RESEND 1/3] regulator: core: Add enable_is_inverted flag to indicate set enable_mask bits to disable

2013-03-04 Thread Axel Lin
2013/3/5 Mark Brown : > On Tue, Mar 05, 2013 at 02:16:00PM +0800, Axel Lin wrote: >> Add enable_is_inverted flag to indicate set enable_mask bits to disable >> when using regulator_enable_regmap and friends APIs. >> >> Signed-off-by: Axel Lin >> Reviewed-by: Hao

[PATCH] gpio: viperboard: Remove duplicate code to set gpio->gpiob_val

2013-03-05 Thread Axel Lin
Set it once is enough, and it's done in vprbrd_gpiob_set() which is called by vprbrd_gpiob_direction_output(). Signed-off-by: Axel Lin --- drivers/gpio/gpio-viperboard.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/gpio/gpio-viperboard.c b/drivers/gpio/gpio-viperbo

[PATCH] power_supply: pm2301_charger: Fix NULL pointer dereference

2013-05-16 Thread Axel Lin
Add checking pl_data in probe, this prevent possible NULL pointer dereference. Also fix NULL pointer deference in dev_err when allocate memory for pm2 fails. Signed-off-by: Axel Lin --- drivers/power/pm2301_charger.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a

[PATCH] power_supply: pm2301_charger: Return error if create_singlethread_workqueue fails

2013-05-16 Thread Axel Lin
Return error instead of 0 if create_singlethread_workqueue call fails. Signed-off-by: Axel Lin --- drivers/power/pm2301_charger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/pm2301_charger.c b/drivers/power/pm2301_charger.c index c972389..6ae3957 100644

[PATCH] gpio: lpc32xx: Fix off-by-one valid range checking for bank

2013-04-07 Thread Axel Lin
The valid bank should be 0 ... ARRAY_SIZE(lpc32xx_gpiochip) - 1. Signed-off-by: Axel Lin --- drivers/gpio/gpio-lpc32xx.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-lpc32xx.c b/drivers/gpio/gpio-lpc32xx.c index 36d7dee..dda6a75 100644 --- a/drivers

[PATCH 1/4] regulator: ab8500: Get rid of is_enabled from struct ab8500_regulator_info

2013-04-07 Thread Axel Lin
(). This change also makes the code better in readability by moving similar functions to one place. Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c | 72 1 file changed, 32 insertions(+), 40 deletions(-) diff --git a/drivers/regulator/ab8500.c

[PATCH 2/4] regulator: ab8500-ext: Get rid of is_enabled from struct ab8500_ext_regulator_info

2013-04-07 Thread Axel Lin
read when set_mode(). Remove is_enabled flag makes the code simpler. Signed-off-by: Axel Lin --- drivers/regulator/ab8500-ext.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c index 57d43a1

[PATCH 3/4] regulator: ab8500-ext: Remove unnecessary checking for ab9540 and ab8540

2013-04-07 Thread Axel Lin
ab9540_ext_regulator_ops is identical to ab8500_ext_regulator_ops[2]. Thus we can complete remove the unnecessary checking for ab9540 and ab8540. [1] https://lkml.org/lkml/2013/3/28/333 [2] https://lkml.org/lkml/2013/4/1/178 Signed-off-by: Axel Lin --- drivers/regulator/ab8500-ext.c |7 ---

[PATCH 4/4] regulator: ab8500-ext: Remove get_voltage to avoid duplicate implementation

2013-04-07 Thread Axel Lin
implemented. Signed-off-by: Axel Lin --- drivers/regulator/ab8500-ext.c | 16 1 file changed, 16 deletions(-) diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c index c7896af..9aee21c 100644 --- a/drivers/regulator/ab8500-ext.c +++ b/drivers/regulator/ab8500

[PATCH] clk: mvebu: Fix valid value range checking for cpu_freq_select

2013-04-07 Thread Axel Lin
cpu_freq_select is used as array subscript, thus the valid value range is 0 ... ARRAY_SIZE() - 1. Signed-off-by: Axel Lin --- drivers/clk/mvebu/clk-core.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/mvebu/clk-core.c b/drivers/clk/mvebu/clk-core.c index

[PATCH] regulator: ab8500: Fix get_mode for shared mode regulators

2013-04-08 Thread Axel Lin
requests to set idle. In get_mode(), we can just remove the special handling code for shared mode. Read the register value always returns correct status no matter the regulator has shared mode register or not. Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c |8 1 file

[PATCH 1/2] regulator: ab8500: Don't update info->update_val if write to register fails

2013-04-09 Thread Axel Lin
This patch ensures info->update_val is consistent with current register value. Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index acdf

[PATCH 2/2] regulator: ab8500: Don't update lp_mode_req flag in set_mode() error paths

2013-04-09 Thread Axel Lin
an up is mainly to avoid adding ugly code to handle failure paths. Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c | 98 +++- 1 file changed, 43 insertions(+), 55 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index

regulator: ab8500-ext: Strange set_mode behavior when info->cfg->hwreq is set

2013-04-09 Thread Axel Lin
Hi, I see below code && comments in enable() function: /* * To satisfy both HW high power request and SW request, the regulator * must be on in high power. */ if (info->cfg && info->cfg->hwreq) *regval = info->update_val_hp; I'm not ver

[PATCH] pinctrl: vt8500: wmt: Fix checking return value of pinctrl_register()

2013-04-09 Thread Axel Lin
pinctrl_register() returns NULL on error. Signed-off-by: Axel Lin --- drivers/pinctrl/vt8500/pinctrl-wmt.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c index 14400a7..ab63104e 100644 --- a

[PATCH RFT 1/2] regulator: ab8500: Fix set voltage for AB8540_LDO_AUX3

2013-04-09 Thread Axel Lin
When setting voltage for AB8540_LDO_AUX3, current code only updates one of info->voltage_reg and info->expand_register registers which is wrong. To ensure we set to correct voltage, it always needs to clear or set expand_register.voltage_mask bit of expand_register. Signed-off-by: Ax

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