[PATCH] regulator: tps51632: Fix writing to wrong register when enable_pwm_dvfs is set
When tps->enable_pwm_dvfs is true, write to TPS51632_VOLTAGE_BASE_REG rather than TPS51632_VOLTAGE_SELECT_REG. Signed-off-by: Axel Lin --- drivers/regulator/tps51632-regulator.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c index a9c3a4a..b22c3f2 100644 --- a/drivers/regulator/tps51632-regulator.c +++ b/drivers/regulator/tps51632-regulator.c @@ -128,7 +128,7 @@ static int tps51632_dcdc_set_voltage_sel(struct regulator_dev *rdev, if (vsel > TPS51632_MAX_VSEL) return -EINVAL; - ret = regmap_write(tps->regmap, TPS51632_VOLTAGE_SELECT_REG, vsel); + ret = regmap_write(tps->regmap, reg, vsel); if (ret < 0) dev_err(tps->dev, "reg write failed, err %d\n", ret); return ret; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFC/RFT][PATCH 1/4] regulator: core: Allow specific minimal selector for starting linear mapping
Some drivers (at least 3 drivers) have such variant of linear mapping that the first few selectors are invalid and the reset are linear mapping. Let's support this case in core. This patch adds linear_min_sel in struct regulator_desc, so we can allow specific minimal selector for starting linear mapping. Then extends regulator_[map|list]_voltage_linear() to support this feature. Note that for selectors less than min_linear_index, we need count them to n_voltages so regulator_list_voltage() won't fail while checking the boundary for selector before calling list_voltage callback. Signed-off-by: Axel Lin --- drivers/regulator/core.c |6 ++ include/linux/regulator/driver.h |2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 3db1e01..273a3b1 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1897,6 +1897,10 @@ int regulator_list_voltage_linear(struct regulator_dev *rdev, { if (selector >= rdev->desc->n_voltages) return -EINVAL; + if (selector < rdev->desc->linear_min_sel) + return 0; + + selector -= rdev->desc->linear_min_sel; return rdev->desc->min_uV + (rdev->desc->uV_step * selector); } @@ -2125,6 +2129,8 @@ int regulator_map_voltage_linear(struct regulator_dev *rdev, if (ret < 0) return ret; + ret += rdev->desc->linear_min_sel; + /* Map back into a voltage to verify we're still in bounds */ voltage = rdev->desc->ops->list_voltage(rdev, ret); if (voltage < min_uV || voltage > max_uV) diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index f2b72b2..d10bb0f 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -187,6 +187,7 @@ enum regulator_type { * * @min_uV: Voltage given by the lowest selector (if linear mapping) * @uV_step: Voltage increase with each selector (if linear mapping) + * @linear_min_sel: Minimal selector for starting linear mapping * @ramp_delay: Time to settle down after voltage change (unit: uV/us) * @volt_table: Voltage mapping table (if table based mapping) * @@ -210,6 +211,7 @@ struct regulator_desc { unsigned int min_uV; unsigned int uV_step; + unsigned int linear_min_sel; unsigned int ramp_delay; const unsigned int *volt_table; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFC/RFT][PATCH 2/4] regulator: da9055: Use linear_min_sel and regulator_[map|list]_voltage_linear
Signed-off-by: Axel Lin --- drivers/regulator/da9055-regulator.c | 55 +- 1 file changed, 8 insertions(+), 47 deletions(-) diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c index db59ce7..a4b9cb8 100644 --- a/drivers/regulator/da9055-regulator.c +++ b/drivers/regulator/da9055-regulator.c @@ -57,7 +57,6 @@ struct da9055_volt_reg { int reg_a; int reg_b; int sl_shift; - int v_offset; int v_mask; int v_shift; }; @@ -201,41 +200,6 @@ static int da9055_buck_set_current_limit(struct regulator_dev *rdev, int min_uA, return -EINVAL; } -static int da9055_list_voltage(struct regulator_dev *rdev, unsigned selector) -{ - struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; - - if (selector >= rdev->desc->n_voltages) - return -EINVAL; - - if (selector < info->volt.v_offset) - return 0; - - selector -= info->volt.v_offset; - return rdev->desc->min_uV + (rdev->desc->uV_step * selector); -} - -static int da9055_map_voltage(struct regulator_dev *rdev, int min_uV, - int max_uV) -{ - struct da9055_regulator *regulator = rdev_get_drvdata(rdev); - struct da9055_regulator_info *info = regulator->info; - int sel, voltage; - - if (min_uV < rdev->desc->min_uV) - min_uV = rdev->desc->min_uV; - - sel = DIV_ROUND_UP(min_uV - rdev->desc->min_uV, rdev->desc->uV_step); - sel += info->volt.v_offset; - - voltage = da9055_list_voltage(rdev, sel); - if (voltage < min_uV || voltage > max_uV) - return -EINVAL; - - return sel; -} - static int da9055_regulator_get_voltage_sel(struct regulator_dev *rdev) { struct da9055_regulator *regulator = rdev_get_drvdata(rdev); @@ -264,10 +228,7 @@ static int da9055_regulator_get_voltage_sel(struct regulator_dev *rdev) return ret; sel = (ret & volt.v_mask); - if (sel <= volt.v_offset) - return 0; - else - return sel; + return sel; } static int da9055_regulator_set_voltage_sel(struct regulator_dev *rdev, @@ -328,7 +289,7 @@ static int da9055_regulator_set_suspend_voltage(struct regulator_dev *rdev, return ret; } - ret = da9055_map_voltage(rdev, uV, uV); + ret = regulator_map_voltage_linear(rdev, uV, uV); if (ret < 0) return ret; @@ -371,8 +332,8 @@ static struct regulator_ops da9055_buck_ops = { .get_voltage_sel = da9055_regulator_get_voltage_sel, .set_voltage_sel = da9055_regulator_set_voltage_sel, - .list_voltage = da9055_list_voltage, - .map_voltage = da9055_map_voltage, + .list_voltage = regulator_list_voltage_linear, + .map_voltage = regulator_map_voltage_linear, .is_enabled = regulator_is_enabled_regmap, .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, @@ -389,8 +350,8 @@ static struct regulator_ops da9055_ldo_ops = { .get_voltage_sel = da9055_regulator_get_voltage_sel, .set_voltage_sel = da9055_regulator_set_voltage_sel, - .list_voltage = da9055_list_voltage, - .map_voltage = da9055_map_voltage, + .list_voltage = regulator_list_voltage_linear, + .map_voltage = regulator_map_voltage_linear, .is_enabled = regulator_is_enabled_regmap, .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, @@ -414,6 +375,7 @@ static struct regulator_ops da9055_ldo_ops = { .enable_mask = 1, \ .min_uV = (min) * 1000,\ .uV_step = (step) * 1000,\ + .linear_min_sel = (voffset),\ .owner = THIS_MODULE,\ },\ .conf = {\ @@ -425,7 +387,6 @@ static struct regulator_ops da9055_ldo_ops = { .reg_a = DA9055_REG_VBCORE_A + DA9055_ID_##_id, \ .reg_b = DA9055_REG_VBCORE_B + DA9055_ID_##_id, \ .sl_shift = 7,\ - .v_offset = (voffset),\ .v_mask = (1 << (vbits)) - 1,\ .v_shift = (vbits),\ },\ @@ -443,6 +404,7 @@ static struct regulator_ops da9055_ldo_ops = { .enable_mask = 1,\ .min_uV = (min) * 1000,\ .uV_step = (step) * 1000,\ + .linear_min_sel = (voffset),\ .owner = THIS_MODULE,\ },\ .conf = {\ @@ -454,7 +416,6 @@ static struct regulator_ops da9055_ldo_ops = { .reg_a = DA9055_REG_VBCORE_A + DA9055_ID_##_id, \ .reg_b = DA9055_REG_VBCORE_B + DA9055_ID_##_id, \ .sl_shift = 7,\ - .v_offset = (vof
[RFC/RFT][PATCH 3/4] regulator: palmas: Use linear_min_sel and regulator_[map|list]_voltage_linear
Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c | 37 +- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 3d44592..d5b0408 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -436,44 +436,14 @@ static int palmas_is_enabled_ldo(struct regulator_dev *dev) return !!(reg); } -static int palmas_list_voltage_ldo(struct regulator_dev *dev, - unsigned selector) -{ - if (!selector) - return 0; - - /* voltage is 0.85V + (selector * 0.05v) */ - return 85 + (selector * 5); -} - -static int palmas_map_voltage_ldo(struct regulator_dev *rdev, - int min_uV, int max_uV) -{ - int ret, voltage; - - if (min_uV == 0) - return 0; - - if (min_uV < 90) - min_uV = 90; - ret = DIV_ROUND_UP(min_uV - 90, 5) + 1; - - /* Map back into a voltage to verify we're still in bounds */ - voltage = palmas_list_voltage_ldo(rdev, ret); - if (voltage < min_uV || voltage > max_uV) - return -EINVAL; - - return ret; -} - static struct regulator_ops palmas_ops_ldo = { .is_enabled = palmas_is_enabled_ldo, .enable = regulator_enable_regmap, .disable= regulator_disable_regmap, .get_voltage_sel= regulator_get_voltage_sel_regmap, .set_voltage_sel= regulator_set_voltage_sel_regmap, - .list_voltage = palmas_list_voltage_ldo, - .map_voltage= palmas_map_voltage_ldo, + .list_voltage = regulator_list_voltage_linear, + .map_voltage= regulator_map_voltage_linear, }; /* @@ -821,6 +791,9 @@ static int palmas_probe(struct platform_device *pdev) pmic->desc[id].type = REGULATOR_VOLTAGE; pmic->desc[id].owner = THIS_MODULE; + pmic->desc[id].min_uV = 90; + pmic->desc[id].uV_step = 5; + pmic->desc[id].linear_min_sel = 1; pmic->desc[id].vsel_reg = PALMAS_BASE_TO_REG(PALMAS_LDO_BASE, palmas_regs_info[id].vsel_addr); pmic->desc[id].vsel_mask = PALMAS_LDO1_VOLTAGE_VSEL_MASK; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFC/RFT][PATCH 4/4] regulator: tps51632: Use linear_min_sel and regulator_[map|list]_voltage_linear
Signed-off-by: Axel Lin --- drivers/regulator/tps51632-regulator.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c index b22c3f2..523b1e5 100644 --- a/drivers/regulator/tps51632-regulator.c +++ b/drivers/regulator/tps51632-regulator.c @@ -106,29 +106,23 @@ static int tps51632_dcdc_get_voltage_sel(struct regulator_dev *rdev) } vsel = data & TPS51632_VOUT_MASK; - - if (vsel < TPS51632_MIN_VSEL) - return 0; - else - return vsel - TPS51632_MIN_VSEL; + return vsel; } static int tps51632_dcdc_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) { struct tps51632_chip *tps = rdev_get_drvdata(rdev); - int vsel; int ret; unsigned int reg = TPS51632_VOLTAGE_SELECT_REG; if (tps->enable_pwm_dvfs) reg = TPS51632_VOLTAGE_BASE_REG; - vsel = selector + TPS51632_MIN_VSEL; - if (vsel > TPS51632_MAX_VSEL) + if (selector > TPS51632_MAX_VSEL) return -EINVAL; - ret = regmap_write(tps->regmap, reg, vsel); + ret = regmap_write(tps->regmap, reg, selector); if (ret < 0) dev_err(tps->dev, "reg write failed, err %d\n", ret); return ret; @@ -254,7 +248,8 @@ static int tps51632_probe(struct i2c_client *client, tps->desc.ramp_delay = TPS51632_DEFAULT_RAMP_DELAY; tps->desc.min_uV = TPS51632_MIN_VOLATGE; tps->desc.uV_step = TPS51632_VOLATGE_STEP_10mV; - tps->desc.n_voltages = (TPS51632_MAX_VSEL - TPS51632_MIN_VSEL) + 1; + tps->desc.linear_min_sel = TPS51632_MIN_VSEL; + tps->desc.n_voltages = TPS51632_MAX_VSEL + 1; tps->desc.ops = &tps51632_dcdc_ops; tps->desc.type = REGULATOR_VOLTAGE; tps->desc.owner = THIS_MODULE; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] mfd: tps65090: MFD_TPS65090 needs to select REGMAP_IRQ
This fixes below build error: drivers/built-in.o: In function `tps65090_i2c_probe': drivers/mfd/tps65090.c:180: undefined reference to `regmap_add_irq_chip' drivers/mfd/tps65090.c:190: undefined reference to `regmap_irq_chip_get_base' drivers/mfd/tps65090.c:203: undefined reference to `regmap_del_irq_chip' drivers/built-in.o: In function `tps65090_i2c_remove': drivers/mfd/tps65090.c:213: undefined reference to `regmap_del_irq_chip' make: *** [vmlinux] Error 1 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 a8fef75..09d43a9 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1015,6 +1015,7 @@ config MFD_TPS65090 depends on I2C=y && GENERIC_HARDIRQS select MFD_CORE select REGMAP_I2C + select REGMAP_IRQ help If you say yes here you get support for the TPS65090 series of Power Management chips. -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] pinctrl: exynos5440/samsung: Staticize pcfgs
I got below build error with random config if CONFIG_PINCTRL_SAMSUNG=y && CONFIG_PINCTRL_EXYNOS5440=y. Fix the build error by making pcfgs static. LD drivers/pinctrl/built-in.o drivers/pinctrl/pinctrl-exynos5440.o: In function `.LANCHOR0': pinctrl-exynos5440.c:(.data+0x54): multiple definition of `pcfgs' drivers/pinctrl/pinctrl-samsung.o:pinctrl-samsung.c:(.data+0x54): first defined here make[2]: *** [drivers/pinctrl/built-in.o] Error 1 make[1]: *** [drivers/pinctrl] Error 2 make: *** [drivers] Error 2 Signed-off-by: Axel Lin --- drivers/pinctrl/pinctrl-exynos5440.c |2 +- drivers/pinctrl/pinctrl-samsung.c|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-exynos5440.c b/drivers/pinctrl/pinctrl-exynos5440.c index b8635f6..07db895 100644 --- a/drivers/pinctrl/pinctrl-exynos5440.c +++ b/drivers/pinctrl/pinctrl-exynos5440.c @@ -117,7 +117,7 @@ struct exynos5440_pinctrl_priv_data { }; /* list of all possible config options supported */ -struct pin_config { +static struct pin_config { char*prop_cfg; unsigned intcfg_type; } pcfgs[] = { diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c index 8f31b65..864fed8 100644 --- a/drivers/pinctrl/pinctrl-samsung.c +++ b/drivers/pinctrl/pinctrl-samsung.c @@ -37,7 +37,7 @@ #define FSUFFIX_LENsizeof(FUNCTION_SUFFIX) /* list of all possible config options supported */ -struct pin_config { +static struct pin_config { char*prop_cfg; unsigned intcfg_type; } pcfgs[] = { -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND] regulator: tps51632: Use linear_min_sel and regulator_[map|list]_voltage_linear
Signed-off-by: Axel Lin --- drivers/regulator/tps51632-regulator.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c index 3460364..dce5eb3 100644 --- a/drivers/regulator/tps51632-regulator.c +++ b/drivers/regulator/tps51632-regulator.c @@ -106,29 +106,23 @@ static int tps51632_dcdc_get_voltage_sel(struct regulator_dev *rdev) } vsel = data & TPS51632_VOUT_MASK; - - if (vsel < TPS51632_MIN_VSEL) - return 0; - else - return vsel - TPS51632_MIN_VSEL; + return vsel; } static int tps51632_dcdc_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) { struct tps51632_chip *tps = rdev_get_drvdata(rdev); - int vsel; int ret; unsigned int reg = TPS51632_VOLTAGE_SELECT_REG; if (tps->enable_pwm_dvfs) reg = TPS51632_VOLTAGE_BASE_REG; - vsel = selector + TPS51632_MIN_VSEL; - if (vsel > TPS51632_MAX_VSEL) + if (selector > TPS51632_MAX_VSEL) return -EINVAL; - ret = regmap_write(tps->regmap, TPS51632_VOLTAGE_SELECT_REG, vsel); + ret = regmap_write(tps->regmap, TPS51632_VOLTAGE_SELECT_REG, selector); if (ret < 0) dev_err(tps->dev, "reg write failed, err %d\n", ret); return ret; @@ -254,7 +248,8 @@ static int __devinit tps51632_probe(struct i2c_client *client, tps->desc.ramp_delay = TPS51632_DEFAULT_RAMP_DELAY; tps->desc.min_uV = TPS51632_MIN_VOLATGE; tps->desc.uV_step = TPS51632_VOLATGE_STEP_10mV; - tps->desc.n_voltages = (TPS51632_MAX_VSEL - TPS51632_MIN_VSEL) + 1; + tps->desc.linear_min_sel = TPS51632_MIN_VSEL; + tps->desc.n_voltages = TPS51632_MAX_VSEL + 1; tps->desc.ops = &tps51632_dcdc_ops; tps->desc.type = REGULATOR_VOLTAGE; tps->desc.owner = THIS_MODULE; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RFT] regulator: pcf50633: Use linear_min_sel and regulator_[map|list]_voltage_linear
This driver can be converted to use linear_min_sel and regulator_[map|list]_voltage_linear. Below shows the equations from datasheet: For AUTOOUT: VO(prog) = 0.625 + auto_out × 0.025 V; e.g. ( to 00101110: reserved) 0010: 1.8 V (min) 01010011: 2.7 V 01101010: 3.275 V 01101011: 3.300 V 01101100: 3.325 V 0111 : 3.800 V (max) The linear mapping start from 0x2f selector. Thus convert this equation to: VO(prog) = 1.8 + (selector - linear_min_sel) × 0.025 V, (min_uV = 180, uV_step = 25000, linear_min_sel = 0x2f) For DOWNxOUT: VO(prog) = 0.625 + downx_out × 0.025 V; e.g. : 0.625 V (min) 00010111 : 1.200 V 0010 : 1.800 V 0101 : 3.000 V (max) For xLDOOUT: VO(prog) = 0.9 + xldo_out × 0.1 V; e.g. 0: 0.9 V 1: 1.0 V 11000 : 3.3 V 11011 : 3.6 V Signed-off-by: Axel Lin --- drivers/regulator/pcf50633-regulator.c | 176 +--- 1 file changed, 28 insertions(+), 148 deletions(-) diff --git a/drivers/regulator/pcf50633-regulator.c b/drivers/regulator/pcf50633-regulator.c index d776f51..534075e 100644 --- a/drivers/regulator/pcf50633-regulator.c +++ b/drivers/regulator/pcf50633-regulator.c @@ -24,12 +24,15 @@ #include #include -#define PCF50633_REGULATOR(_name, _id, _n) \ +#define PCF50633_REGULATOR(_name, _id, _min_uV, _uV_step, _min_sel, _n) \ { \ .name = _name, \ .id = PCF50633_REGULATOR_##_id, \ .ops = &pcf50633_regulator_ops, \ .n_voltages = _n, \ + .min_uV = _min_uV, \ + .uV_step = _uV_step,\ + .linear_min_sel = _min_sel, \ .type = REGULATOR_VOLTAGE, \ .owner = THIS_MODULE, \ .vsel_reg = PCF50633_REG_##_id##OUT,\ @@ -38,162 +41,39 @@ .enable_mask = PCF50633_REGULATOR_ON, \ } -/* Bits from voltage value */ -static u8 auto_voltage_bits(unsigned int millivolts) -{ - if (millivolts < 1800) - return 0x2f; - if (millivolts > 3800) - return 0xff; - - millivolts -= 625; - - return millivolts / 25; -} - -static u8 down_voltage_bits(unsigned int millivolts) -{ - if (millivolts < 625) - return 0; - else if (millivolts > 3000) - return 0xff; - - millivolts -= 625; - - return millivolts / 25; -} - -static u8 ldo_voltage_bits(unsigned int millivolts) -{ - if (millivolts < 900) - return 0; - else if (millivolts > 3600) - return 0x1f; - - millivolts -= 900; - return millivolts / 100; -} - -/* Obtain voltage value from bits */ -static unsigned int auto_voltage_value(u8 bits) -{ - /* AUTOOUT: to 00101110 are reserved. -* Return 0 for bits in reserved range, which means this selector code -* can't be used on this system */ - if (bits < 0x2f) - return 0; - - return 625 + (bits * 25); -} - - -static unsigned int down_voltage_value(u8 bits) -{ - return 625 + (bits * 25); -} - - -static unsigned int ldo_voltage_value(u8 bits) -{ - bits &= 0x1f; - - return 900 + (bits * 100); -} - -static int pcf50633_regulator_map_voltage(struct regulator_dev *rdev, - int min_uV, int max_uV) -{ - struct pcf50633 *pcf; - int regulator_id, millivolts; - u8 volt_bits; - - pcf = rdev_get_drvdata(rdev); - - regulator_id = rdev_get_id(rdev); - if (regulator_id >= PCF50633_NUM_REGULATORS) - return -EINVAL; - - millivolts = min_uV / 1000; - - switch (regulator_id) { - case PCF50633_REGULATOR_AUTO: - volt_bits = auto_voltage_bits(millivolts); - break; - case PCF50633_REGULATOR_DOWN1: - case PCF50633_REGULATOR_DOWN2: - volt_bits = down_voltage_bits(millivolts); - break; - case PCF50633_REGULATOR_LDO1: - case PCF50633_REGULATOR_LDO2: - case PCF50633_REGULATOR_LDO3: - case PCF50633_REGULATOR_LDO4: - case PCF50633_REGULATOR_LDO5: - case PCF50633_REGULATOR_LDO6: - case PCF50633_REGULATOR_HCLDO: - case PCF50633_REGULATOR_MEMLDO: - volt_bits = ldo_voltage_bits(millivolts); - break; - default: - return -EINVAL; - } - - return volt_bits; -} - -static int pcf50633_regulator_li
[PATCH RFT RESEND] regulator: pcf50633: Use linear_min_sel and regulator_[map|list]_voltage_linear
This driver can be converted to use linear_min_sel and regulator_[map|list]_voltage_linear. Below shows the equation (from Datasheet) for each LDOs. For AUTOOUT: VO(prog) = 0.625 + auto_out x 0.025 V; e.g. ( to 00101110: reserved) 0010: 1.8 V (min) 01010011: 2.7 V 01101010: 3.275 V 01101011: 3.300 V 01101100: 3.325 V 0111 : 3.800 V (max) The linear mapping start from 0x2f selector. Thus we convert this equation to: VO(prog) = 1.8 + (selector - linear_min_sel) x 0.025 V (min_uV = 180, uV_step = 25000, linear_min_sel = 0x2f) For DOWNxOUT: VO(prog) = 0.625 + downx_out x 0.025 V; e.g. : 0.625 V (min) 00010111 : 1.200 V 0010 : 1.800 V 0101 : 3.000 V (max) For xLDOOUT: VO(prog) = 0.9 + xldo_out x 0.1 V; e.g. 0: 0.9 V 1: 1.0 V 11000 : 3.3 V 11011 : 3.6 V Signed-off-by: Axel Lin --- Seems directly copy paste from the datasheet(pdf) adds some UTF-8 characters in the patch. Fix it and resend. Axel drivers/regulator/pcf50633-regulator.c | 176 +--- 1 file changed, 28 insertions(+), 148 deletions(-) diff --git a/drivers/regulator/pcf50633-regulator.c b/drivers/regulator/pcf50633-regulator.c index d776f51..534075e 100644 --- a/drivers/regulator/pcf50633-regulator.c +++ b/drivers/regulator/pcf50633-regulator.c @@ -24,12 +24,15 @@ #include #include -#define PCF50633_REGULATOR(_name, _id, _n) \ +#define PCF50633_REGULATOR(_name, _id, _min_uV, _uV_step, _min_sel, _n) \ { \ .name = _name, \ .id = PCF50633_REGULATOR_##_id, \ .ops = &pcf50633_regulator_ops, \ .n_voltages = _n, \ + .min_uV = _min_uV, \ + .uV_step = _uV_step,\ + .linear_min_sel = _min_sel, \ .type = REGULATOR_VOLTAGE, \ .owner = THIS_MODULE, \ .vsel_reg = PCF50633_REG_##_id##OUT,\ @@ -38,162 +41,39 @@ .enable_mask = PCF50633_REGULATOR_ON, \ } -/* Bits from voltage value */ -static u8 auto_voltage_bits(unsigned int millivolts) -{ - if (millivolts < 1800) - return 0x2f; - if (millivolts > 3800) - return 0xff; - - millivolts -= 625; - - return millivolts / 25; -} - -static u8 down_voltage_bits(unsigned int millivolts) -{ - if (millivolts < 625) - return 0; - else if (millivolts > 3000) - return 0xff; - - millivolts -= 625; - - return millivolts / 25; -} - -static u8 ldo_voltage_bits(unsigned int millivolts) -{ - if (millivolts < 900) - return 0; - else if (millivolts > 3600) - return 0x1f; - - millivolts -= 900; - return millivolts / 100; -} - -/* Obtain voltage value from bits */ -static unsigned int auto_voltage_value(u8 bits) -{ - /* AUTOOUT: to 00101110 are reserved. -* Return 0 for bits in reserved range, which means this selector code -* can't be used on this system */ - if (bits < 0x2f) - return 0; - - return 625 + (bits * 25); -} - - -static unsigned int down_voltage_value(u8 bits) -{ - return 625 + (bits * 25); -} - - -static unsigned int ldo_voltage_value(u8 bits) -{ - bits &= 0x1f; - - return 900 + (bits * 100); -} - -static int pcf50633_regulator_map_voltage(struct regulator_dev *rdev, - int min_uV, int max_uV) -{ - struct pcf50633 *pcf; - int regulator_id, millivolts; - u8 volt_bits; - - pcf = rdev_get_drvdata(rdev); - - regulator_id = rdev_get_id(rdev); - if (regulator_id >= PCF50633_NUM_REGULATORS) - return -EINVAL; - - millivolts = min_uV / 1000; - - switch (regulator_id) { - case PCF50633_REGULATOR_AUTO: - volt_bits = auto_voltage_bits(millivolts); - break; - case PCF50633_REGULATOR_DOWN1: - case PCF50633_REGULATOR_DOWN2: - volt_bits = down_voltage_bits(millivolts); - break; - case PCF50633_REGULATOR_LDO1: - case PCF50633_REGULATOR_LDO2: - case PCF50633_REGULATOR_LDO3: - case PCF50633_REGULATOR_LDO4: - case PCF50633_REGULATOR_LDO5: - case PCF50633_REGULATOR_LDO6: - case PCF50633_REGULATOR_HCLDO: - case PCF50633_REGULATOR_MEMLDO: - volt_bits = ldo_voltage_bits(millivolts); -
[PATCH RESEND] pinctrl: Drop selecting PINCONF for MMP2, PXA168 and PXA910
These drivers do not need to select PINCONF. Signed-off-by: Axel Lin --- This patch was sent on https://lkml.org/lkml/2012/11/12/12. Resend to Haojian's correct email address. drivers/pinctrl/Kconfig |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index f06a073..c31aeb0 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -96,7 +96,6 @@ config PINCTRL_MMP2 bool "MMP2 pin controller driver" depends on ARCH_MMP select PINCTRL_PXA3xx - select PINCONF config PINCTRL_MXS bool @@ -133,13 +132,11 @@ config PINCTRL_PXA168 bool "PXA168 pin controller driver" depends on ARCH_MMP select PINCTRL_PXA3xx - select PINCONF config PINCTRL_PXA910 bool "PXA910 pin controller driver" depends on ARCH_MMP select PINCTRL_PXA3xx - select PINCONF config PINCTRL_SINGLE tristate "One-register-per-pin type device tree based pinctrl driver" -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ARM: mmp: select PINCTRL for ARCH_MMP
This makes PINCTRL related config options visible. Otherwise there is no way to build pinctrl drivers for MMP2, PXA168 and PXA910. Signed-off-by: Axel Lin --- This patch was sent on https://lkml.org/lkml/2012/11/12/10 Resend to Haojian's correct email address. arch/arm/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 1fd4208..2f8bfd4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -591,6 +591,7 @@ config ARCH_MMP select GPIO_PXA select IRQ_DOMAIN select NEED_MACH_GPIO_H + select PINCTRL select PLAT_PXA select SPARSE_IRQ help -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFT][PATCH 1/2] regulator: palmas: Return raw register values as the selectors in [get|set]_voltage_sel
Don't adjust the selector in [get|set]_voltage_sel, fix it in list_voltage() instead. For smps*(except smps10), the vsel reg-value and voltage mapping as below: reg-value volt (uV) ( Assume RANGE is x1 ) 0 0 1 50 2 50 3 50 4 50 5 50 6 50 (0.49V + 1 * 0.01V) * RANGE 7 51 (0.49V + 2 * 0.01V) * RANGE 8 52 (0.49V + 3 * 0.01V) * RANGE 9 53 (0.49V + 4 * 0.01V) * RANGE The linear mapping is start from selector 6. Signed-off-by: Axel Lin --- hi Graeme, I don't have this hardware, I'd appreciate if you can review and test this patch. I think it should be no behavior change with these 2 patches. Note I don't have the datasheet, the reg-value and voltage mapping is from my understanding of the current code. Regards, Axel drivers/regulator/palmas-regulator.c | 38 +- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index fd27a43..76eaafb 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -309,19 +309,22 @@ static int palmas_list_voltage_smps(struct regulator_dev *dev, int id = rdev_get_id(dev); int mult = 1; - if (!selector) - return 0; - /* Read the multiplier set in VSEL register to return * the correct voltage. */ if (pmic->range[id]) mult = 2; - /* Voltage is (0.49V + (selector * 0.01V)) * RANGE -* as defined in data sheet. RANGE is either x1 or x2 -*/ - return (49 + (selector * 1)) * mult; + if (selector == 0) + return 0; + else if (selector < 6) + return 50 * mult; + else + /* Voltage is linear mapping starting from selector 6, +* volt = (0.49V + ((selector - 5) * 0.01V)) * RANGE +* RANGE is either x1 or x2 +*/ + return (49 + ((selector - 5) * 1)) * mult; } static int palmas_get_voltage_smps_sel(struct regulator_dev *dev) @@ -338,15 +341,6 @@ static int palmas_get_voltage_smps_sel(struct regulator_dev *dev) selector = reg & PALMAS_SMPS12_VOLTAGE_VSEL_MASK; - /* Adjust selector to match list_voltage ranges */ - if ((selector > 0) && (selector < 6)) - selector = 6; - if (!selector) - selector = 5; - if (selector > 121) - selector = 121; - selector -= 5; - return selector; } @@ -355,19 +349,15 @@ static int palmas_set_voltage_smps_sel(struct regulator_dev *dev, { struct palmas_pmic *pmic = rdev_get_drvdata(dev); int id = rdev_get_id(dev); - unsigned int reg = 0; - unsigned int addr; + unsigned int reg, addr; addr = palmas_regs_info[id].vsel_addr; + reg = selector; /* Make sure we don't change the value of RANGE */ if (pmic->range[id]) reg |= PALMAS_SMPS12_VOLTAGE_RANGE; - /* Adjust the linux selector into range used in VSEL register */ - if (selector) - reg |= selector + 5; - palmas_smps_write(pmic->palmas, addr, reg); return 0; @@ -386,11 +376,11 @@ static int palmas_map_voltage_smps(struct regulator_dev *rdev, if (pmic->range[id]) { /* RANGE is x2 */ if (min_uV < 100) min_uV = 100; - ret = DIV_ROUND_UP(min_uV - 100, 2) + 1; + ret = DIV_ROUND_UP(min_uV - 100, 2) + 6; } else {/* RANGE is x1 */ if (min_uV < 50) min_uV = 50; - ret = DIV_ROUND_UP(min_uV - 50, 1) + 1; + ret = DIV_ROUND_UP(min_uV - 50, 1) + 6; } /* Map back into a voltage to verify we're still in bounds */ -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFT][PATCH 2/2] regulator: palmas: Convert palmas_ops_smps to regulator_[get|set]_voltage_sel_regmap
Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c | 87 ++ 1 file changed, 26 insertions(+), 61 deletions(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 76eaafb..932cc05 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -327,42 +327,6 @@ static int palmas_list_voltage_smps(struct regulator_dev *dev, return (49 + ((selector - 5) * 1)) * mult; } -static int palmas_get_voltage_smps_sel(struct regulator_dev *dev) -{ - struct palmas_pmic *pmic = rdev_get_drvdata(dev); - int id = rdev_get_id(dev); - int selector; - unsigned int reg; - unsigned int addr; - - addr = palmas_regs_info[id].vsel_addr; - - palmas_smps_read(pmic->palmas, addr, ®); - - selector = reg & PALMAS_SMPS12_VOLTAGE_VSEL_MASK; - - return selector; -} - -static int palmas_set_voltage_smps_sel(struct regulator_dev *dev, - unsigned selector) -{ - struct palmas_pmic *pmic = rdev_get_drvdata(dev); - int id = rdev_get_id(dev); - unsigned int reg, addr; - - addr = palmas_regs_info[id].vsel_addr; - reg = selector; - - /* Make sure we don't change the value of RANGE */ - if (pmic->range[id]) - reg |= PALMAS_SMPS12_VOLTAGE_RANGE; - - palmas_smps_write(pmic->palmas, addr, reg); - - return 0; -} - static int palmas_map_voltage_smps(struct regulator_dev *rdev, int min_uV, int max_uV) { @@ -397,8 +361,8 @@ static struct regulator_ops palmas_ops_smps = { .disable= palmas_disable_smps, .set_mode = palmas_set_mode_smps, .get_mode = palmas_get_mode_smps, - .get_voltage_sel= palmas_get_voltage_smps_sel, - .set_voltage_sel= palmas_set_voltage_smps_sel, + .get_voltage_sel= regulator_get_voltage_sel_regmap, + .set_voltage_sel= regulator_set_voltage_sel_regmap, .list_voltage = palmas_list_voltage_smps, .map_voltage= palmas_map_voltage_smps, }; @@ -693,6 +657,14 @@ static int palmas_probe(struct platform_device *pdev) continue; } + /* Initialise sleep/init values from platform data */ + if (pdata && pdata->reg_init[id]) { + reg_init = pdata->reg_init[id]; + ret = palmas_smps_init(palmas, id, reg_init); + if (ret) + goto err_unregister_regulator; + } + /* Register the regulators */ pmic->desc[id].name = palmas_regs_info[id].name; pmic->desc[id].id = id; @@ -713,29 +685,11 @@ static int palmas_probe(struct platform_device *pdev) pmic->desc[id].uV_step = 125; break; default: - pmic->desc[id].ops = &palmas_ops_smps; - pmic->desc[id].n_voltages = PALMAS_SMPS_NUM_VOLTAGES; - } - - pmic->desc[id].type = REGULATOR_VOLTAGE; - pmic->desc[id].owner = THIS_MODULE; - - /* Initialise sleep/init values from platform data */ - if (pdata) { - reg_init = pdata->reg_init[id]; - if (reg_init) { - ret = palmas_smps_init(palmas, id, reg_init); - if (ret) - goto err_unregister_regulator; - } - } - - /* -* read and store the RANGE bit for later use -* This must be done before regulator is probed otherwise -* we error in probe with unsuportable ranges. -*/ - if (id != PALMAS_REG_SMPS10) { + /* +* Read and store the RANGE bit for later use +* This must be done before regulator is probed, +* otherwise we error in probe with unsupportable ranges. +*/ addr = palmas_regs_info[id].vsel_addr; ret = palmas_smps_read(pmic->palmas, addr, ®); @@ -743,8 +697,19 @@ static int palmas_probe(struct platform_device *pdev) goto err_unregister_regulator; if (reg & PALMAS_SMPS12_VOLTAGE_RANGE) pmic->range[id] = 1; + + pmic->desc[id].ops = &palmas_ops_smps; + pmic->desc[id].n_voltages = PALMAS_SMPS_NUM_VOLTAGES; + pmic->desc[id].vse
[PATCH RFT] regulator: max1586: Implement get_voltage_sel callback
This is required since commit f7df20ec32 "regulator: core: Use list_voltage() to read single voltage regulators", otherwise _regulator_get_voltage returns rdev->desc->ops->list_voltage(rdev, 0). The Maxim 1586 controls V3 and V6 voltages, but offers no way of reading back the set up value. Thus this patch caches the setting when setting new voltage. Signed-off-by: Axel Lin --- drivers/regulator/max1586.c | 44 --- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index 3a035ec..98ffa0d 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c @@ -44,6 +44,9 @@ struct max1586_data { unsigned int min_uV; unsigned int max_uV; + unsigned int v3_curr_sel; + unsigned int v6_curr_sel; + struct regulator_dev *rdev[0]; }; @@ -63,31 +66,60 @@ static int v6_voltages_uv[] = { 1, 180, 250, 300 }; * R24 and R25=100kOhm as described in the data sheet. * The gain is approximately: 1 + R24/R25 + R24/185.5kOhm */ +static int max1586_v3_get_voltage_sel(struct regulator_dev *rdev) +{ + struct max1586_data *max1586 = rdev_get_drvdata(rdev); + + return regulator_list_voltage_linear(rdev, max1586->v3_curr_sel); +} + static int max1586_v3_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) { struct max1586_data *max1586 = rdev_get_drvdata(rdev); struct i2c_client *client = max1586->client; + int ret; u8 v3_prog; dev_dbg(&client->dev, "changing voltage v3 to %dmv\n", regulator_list_voltage_linear(rdev, selector) / 1000); v3_prog = I2C_V3_SELECT | (u8) selector; - return i2c_smbus_write_byte(client, v3_prog); + ret = i2c_smbus_write_byte(client, v3_prog); + if (ret) + return ret; + + max1586->v3_curr_sel = selector; + + return 0; +} + +static int max1586_v6_get_voltage_sel(struct regulator_dev *rdev) +{ + struct max1586_data *max1586 = rdev_get_drvdata(rdev); + + return regulator_list_voltage_table(rdev, max1586->v6_curr_sel); } static int max1586_v6_set_voltage_sel(struct regulator_dev *rdev, unsigned int selector) { - struct i2c_client *client = rdev_get_drvdata(rdev); + struct max1586_data *max1586 = rdev_get_drvdata(rdev); + struct i2c_client *client = max1586->client; u8 v6_prog; + int ret; dev_dbg(&client->dev, "changing voltage v6 to %dmv\n", rdev->desc->volt_table[selector] / 1000); v6_prog = I2C_V6_SELECT | (u8) selector; - return i2c_smbus_write_byte(client, v6_prog); + ret = i2c_smbus_write_byte(client, v6_prog); + if (ret) + return ret; + + max1586->v6_curr_sel = selector; + + return 0; } /* @@ -95,12 +127,14 @@ static int max1586_v6_set_voltage_sel(struct regulator_dev *rdev, * the set up value. */ static struct regulator_ops max1586_v3_ops = { + .get_voltage_sel = max1586_v3_get_voltage_sel, .set_voltage_sel = max1586_v3_set_voltage_sel, .list_voltage = regulator_list_voltage_linear, .map_voltage = regulator_map_voltage_linear, }; static struct regulator_ops max1586_v6_ops = { + .get_voltage_sel = max1586_v6_get_voltage_sel, .set_voltage_sel = max1586_v6_set_voltage_sel, .list_voltage = regulator_list_voltage_table, }; @@ -148,6 +182,10 @@ static int max1586_pmic_probe(struct i2c_client *client, max1586->min_uV = MAX1586_V3_MIN_UV / 1000 * pdata->v3_gain / 1000; max1586->max_uV = MAX1586_V3_MAX_UV / 1000 * pdata->v3_gain / 1000; + /* Set curr_sel to default voltage on power-up */ + max1586->v3_curr_sel = 24; /* 1.3V */ + max1586->v6_curr_sel = 0; + rdev = max1586->rdev; for (i = 0; i < pdata->num_subdevs && i <= MAX1586_V6; i++) { id = pdata->subdevs[i].id; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RFT v2] regulator: max1586: Implement get_voltage_sel callback
This is required since commit f7df20ec32 "regulator: core: Use list_voltage() to read single voltage regulators", otherwise _regulator_get_voltage returns rdev->desc->ops->list_voltage(rdev, 0). The Maxim 1586 controls V3 and V6 voltages, but offers no way of reading back the set up value. Thus this patch caches the setting when setting new voltage. Signed-off-by: Axel Lin --- v2: get_voltage_sel returns selector rather than voltage. drivers/regulator/max1586.c | 44 --- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index 3a035ec..8c5a54f 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c @@ -44,6 +44,9 @@ struct max1586_data { unsigned int min_uV; unsigned int max_uV; + unsigned int v3_curr_sel; + unsigned int v6_curr_sel; + struct regulator_dev *rdev[0]; }; @@ -63,31 +66,60 @@ static int v6_voltages_uv[] = { 1, 180, 250, 300 }; * R24 and R25=100kOhm as described in the data sheet. * The gain is approximately: 1 + R24/R25 + R24/185.5kOhm */ +static int max1586_v3_get_voltage_sel(struct regulator_dev *rdev) +{ + struct max1586_data *max1586 = rdev_get_drvdata(rdev); + + return max1586->v3_curr_sel; +} + static int max1586_v3_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) { struct max1586_data *max1586 = rdev_get_drvdata(rdev); struct i2c_client *client = max1586->client; + int ret; u8 v3_prog; dev_dbg(&client->dev, "changing voltage v3 to %dmv\n", regulator_list_voltage_linear(rdev, selector) / 1000); v3_prog = I2C_V3_SELECT | (u8) selector; - return i2c_smbus_write_byte(client, v3_prog); + ret = i2c_smbus_write_byte(client, v3_prog); + if (ret) + return ret; + + max1586->v3_curr_sel = selector; + + return 0; +} + +static int max1586_v6_get_voltage_sel(struct regulator_dev *rdev) +{ + struct max1586_data *max1586 = rdev_get_drvdata(rdev); + + return max1586->v6_curr_sel; } static int max1586_v6_set_voltage_sel(struct regulator_dev *rdev, unsigned int selector) { - struct i2c_client *client = rdev_get_drvdata(rdev); + struct max1586_data *max1586 = rdev_get_drvdata(rdev); + struct i2c_client *client = max1586->client; u8 v6_prog; + int ret; dev_dbg(&client->dev, "changing voltage v6 to %dmv\n", rdev->desc->volt_table[selector] / 1000); v6_prog = I2C_V6_SELECT | (u8) selector; - return i2c_smbus_write_byte(client, v6_prog); + ret = i2c_smbus_write_byte(client, v6_prog); + if (ret) + return ret; + + max1586->v6_curr_sel = selector; + + return 0; } /* @@ -95,12 +127,14 @@ static int max1586_v6_set_voltage_sel(struct regulator_dev *rdev, * the set up value. */ static struct regulator_ops max1586_v3_ops = { + .get_voltage_sel = max1586_v3_get_voltage_sel, .set_voltage_sel = max1586_v3_set_voltage_sel, .list_voltage = regulator_list_voltage_linear, .map_voltage = regulator_map_voltage_linear, }; static struct regulator_ops max1586_v6_ops = { + .get_voltage_sel = max1586_v6_get_voltage_sel, .set_voltage_sel = max1586_v6_set_voltage_sel, .list_voltage = regulator_list_voltage_table, }; @@ -148,6 +182,10 @@ static int max1586_pmic_probe(struct i2c_client *client, max1586->min_uV = MAX1586_V3_MIN_UV / 1000 * pdata->v3_gain / 1000; max1586->max_uV = MAX1586_V3_MAX_UV / 1000 * pdata->v3_gain / 1000; + /* Set curr_sel to default voltage on power-up */ + max1586->v3_curr_sel = 24; /* 1.3V */ + max1586->v6_curr_sel = 0; + rdev = max1586->rdev; for (i = 0; i < pdata->num_subdevs && i <= MAX1586_V6; i++) { id = pdata->subdevs[i].id; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] OMAPDSS: Add terminating entry for picodlp_i2c_id table
The i2c_device_id table is supposed to be zero-terminated. Signed-off-by: Axel Lin --- drivers/video/omap2/displays/panel-picodlp.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/omap2/displays/panel-picodlp.c b/drivers/video/omap2/displays/panel-picodlp.c index e3a6c19..1b94018 100644 --- a/drivers/video/omap2/displays/panel-picodlp.c +++ b/drivers/video/omap2/displays/panel-picodlp.c @@ -50,6 +50,7 @@ struct picodlp_i2c_data { static struct i2c_device_id picodlp_i2c_id[] = { { "picodlp_i2c_driver", 0 }, + { } }; struct picodlp_i2c_command { -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: wm831x-dcdc: Ensure selected voltage falls within requested range
Use DIV_ROUND_UP to ensure selected voltage won't less than min_uV due to integer truncation. Signed-off-by: Axel Lin --- drivers/regulator/wm831x-dcdc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index bce2565..96450f1 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c @@ -223,7 +223,7 @@ static int wm831x_buckv_map_voltage(struct regulator_dev *rdev, if (min_uV < 60) vsel = 0; else if (min_uV <= 180) - vsel = ((min_uV - 60) / 12500) + 8; + vsel = DIV_ROUND_UP(min_uV - 60, 12500) + 8; else return -EINVAL; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: tps51632: Ensure [base|max]_voltage_uV pdata settings are valid
If pdata->base_voltage_uV is missing or the settings of pdata->base_voltage_uV and pdata->max_voltage_uV are out of range, TPS51632_VOLT_VSEL macro returns wrong vsel. Thus add checking [base|max]_voltage_uV pdata settings in probe. Signed-off-by: Axel Lin --- drivers/regulator/tps51632-regulator.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c index 523b1e5..ab21133 100644 --- a/drivers/regulator/tps51632-regulator.c +++ b/drivers/regulator/tps51632-regulator.c @@ -236,6 +236,21 @@ static int tps51632_probe(struct i2c_client *client, return -EINVAL; } + if (pdata->enable_pwm_dvfs) { + if ((pdata->base_voltage_uV < TPS51632_MIN_VOLATGE) || + (pdata->base_voltage_uV > TPS51632_MAX_VOLATGE)) { + dev_err(&client->dev, "Invalid base_voltage_uV setting\n"); + return -EINVAL; + } + + if ((pdata->max_voltage_uV) && + ((pdata->max_voltage_uV < TPS51632_MIN_VOLATGE) || +(pdata->max_voltage_uV > TPS51632_MAX_VOLATGE))) { + dev_err(&client->dev, "Invalid max_voltage_uV setting\n"); + return -EINVAL; + } + } + tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); if (!tps) { dev_err(&client->dev, "Memory allocation failed\n"); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] PM / devfreq: exynos4_bus: Constify clock divider table
These tables are never modified, make them const. Signed-off-by: Axel Lin --- drivers/devfreq/exynos4_bus.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/devfreq/exynos4_bus.c b/drivers/devfreq/exynos4_bus.c index 3f37f3b..45d00d1 100644 --- a/drivers/devfreq/exynos4_bus.c +++ b/drivers/devfreq/exynos4_bus.c @@ -177,7 +177,7 @@ static unsigned int exynos4x12_int_volt[][EX4x12_LV_NUM] = { }; /*** Clock Divider Data for Exynos4210 ***/ -static unsigned int exynos4210_clkdiv_dmc0[][8] = { +static const unsigned int exynos4210_clkdiv_dmc0[][8] = { /* * Clock divider value for following * { DIVACP, DIVACP_PCLK, DIVDPHY, DIVDMC, DIVDMCD @@ -191,7 +191,7 @@ static unsigned int exynos4210_clkdiv_dmc0[][8] = { /* DMC L2: 133MHz */ { 5, 1, 1, 5, 1, 1, 3, 1 }, }; -static unsigned int exynos4210_clkdiv_top[][5] = { +static const unsigned int exynos4210_clkdiv_top[][5] = { /* * Clock divider value for following * { DIVACLK200, DIVACLK100, DIVACLK160, DIVACLK133, DIVONENAND } @@ -203,7 +203,7 @@ static unsigned int exynos4210_clkdiv_top[][5] = { /* ACLK200 L2: 133MHz */ { 5, 7, 7, 7, 1 }, }; -static unsigned int exynos4210_clkdiv_lr_bus[][2] = { +static const unsigned int exynos4210_clkdiv_lr_bus[][2] = { /* * Clock divider value for following * { DIVGDL/R, DIVGPL/R } @@ -217,7 +217,7 @@ static unsigned int exynos4210_clkdiv_lr_bus[][2] = { }; /*** Clock Divider Data for Exynos4212/4412 ***/ -static unsigned int exynos4x12_clkdiv_dmc0[][6] = { +static const unsigned int exynos4x12_clkdiv_dmc0[][6] = { /* * Clock divider value for following * { DIVACP, DIVACP_PCLK, DIVDPHY, DIVDMC, DIVDMCD @@ -235,7 +235,7 @@ static unsigned int exynos4x12_clkdiv_dmc0[][6] = { /* DMC L4: 100MHz */ {7, 1, 1, 7, 1, 1}, }; -static unsigned int exynos4x12_clkdiv_dmc1[][6] = { +static const unsigned int exynos4x12_clkdiv_dmc1[][6] = { /* * Clock divider value for following * { G2DACP, DIVC2C, DIVC2C_ACLK } @@ -252,7 +252,7 @@ static unsigned int exynos4x12_clkdiv_dmc1[][6] = { /* DMC L4: 100MHz */ {7, 7, 1}, }; -static unsigned int exynos4x12_clkdiv_top[][5] = { +static const unsigned int exynos4x12_clkdiv_top[][5] = { /* * Clock divider value for following * { DIVACLK266_GPS, DIVACLK100, DIVACLK160, @@ -270,7 +270,7 @@ static unsigned int exynos4x12_clkdiv_top[][5] = { /* ACLK_GDL/R L4: 100MHz */ {7, 7, 7, 7, 1}, }; -static unsigned int exynos4x12_clkdiv_lr_bus[][2] = { +static const unsigned int exynos4x12_clkdiv_lr_bus[][2] = { /* * Clock divider value for following * { DIVGDL/R, DIVGPL/R } @@ -287,7 +287,7 @@ static unsigned int exynos4x12_clkdiv_lr_bus[][2] = { /* ACLK_GDL/R L4: 100MHz */ {7, 1}, }; -static unsigned int exynos4x12_clkdiv_sclkip[][3] = { +static const unsigned int exynos4x12_clkdiv_sclkip[][3] = { /* * Clock divider value for following * { DIVMFC, DIVJPEG, DIVFIMC0~3} -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] PM / devfreq: exynos4_bus: Fix table entry size for exynos4x12_clkdiv_dmc1
exynos4x12_clkdiv_dmc1 contains { G2DACP, DIVC2C, DIVC2C_ACLK }, thus set the size to 3 rather than 6. Signed-off-by: Axel Lin --- drivers/devfreq/exynos4_bus.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/exynos4_bus.c b/drivers/devfreq/exynos4_bus.c index 45d00d1..1deee09 100644 --- a/drivers/devfreq/exynos4_bus.c +++ b/drivers/devfreq/exynos4_bus.c @@ -235,7 +235,7 @@ static const unsigned int exynos4x12_clkdiv_dmc0[][6] = { /* DMC L4: 100MHz */ {7, 1, 1, 7, 1, 1}, }; -static const unsigned int exynos4x12_clkdiv_dmc1[][6] = { +static const unsigned int exynos4x12_clkdiv_dmc1[][3] = { /* * Clock divider value for following * { G2DACP, DIVC2C, DIVC2C_ACLK } -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] PM / devfreq: exynos4_bus: Fix missing mutex_unlock if opp_find_freq_floor fails
We need to call mutex_unlock() in the error path. Signed-off-by: Axel Lin --- drivers/devfreq/exynos4_bus.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/devfreq/exynos4_bus.c b/drivers/devfreq/exynos4_bus.c index 1deee09..54b9615 100644 --- a/drivers/devfreq/exynos4_bus.c +++ b/drivers/devfreq/exynos4_bus.c @@ -974,7 +974,8 @@ static int exynos4_busfreq_pm_notifier_event(struct notifier_block *this, rcu_read_unlock(); dev_err(data->dev, "%s: unable to find a min freq\n", __func__); - return PTR_ERR(opp); + err = PTR_ERR(opp); + goto unlock; } new_oppinfo.rate = opp_get_freq(opp); new_oppinfo.volt = opp_get_voltage(opp); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] BUG: pinmux: release only taken pins on error
2013/3/20 Richard Genoud : > commit e38d457de7be63e6ced1ea254aa51466deb1fef0 > pinctrl: pinmux: Release all taken pins in pinmux_enable_setting > > Introduced a bug in the release pin mechanism. > All the pins (taken or not) where released. > For instance, if a i2c function has already taken pins 5 and 6. > And the pins of function PHY are requested (pins 3 4 5 6 7). > The pins 3 and 4 will be taken, pin 5 is already taken, so the function > fails. > And we have pins 3 and 4 release, which is ok. But also pins 5 and 6 !. > And also pin 7 (which will have its mux_usecount to -1...) > > This patch reset the original behaviour. > > Signed-off-by: Richard Genoud > --- > drivers/pinctrl/pinmux.c |2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c > index 1a00658..917e830 100644 > --- a/drivers/pinctrl/pinmux.c > +++ b/drivers/pinctrl/pinmux.c > @@ -409,6 +409,8 @@ int pinmux_enable_setting(struct pinctrl_setting const > *setting) > dev_err(pctldev->dev, > "could not request pin %d on device %s\n", > pins[i], pinctrl_dev_get_name(pctldev)); > + /* On error release *only* taken pins */ > + num_pins = i - 1; /* this pin just failed */ This seems pointless, in the goto err_pin_request path, the code does not use num_pins variable at all. > goto err_pin_request; see the code in err_pin_request, it actually does "while (--i>-0", so it won't call pin_free for the just failed pin. err_pin_request: /* On error release all taken pins */ while (--i >= 0) pin_free(pctldev, pins[i], NULL); return ret; -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[linux-next] Not able to fetch next-20130321
Hi Stephen, I run "git remote update" but cannot find next-20130321 tag. It seems the latest tag is "next-20130318". https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/ Can you take a look at this issue? Thanks, 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: palmas: Remove a redundant setting for warm_reset
Current code read "ti,warm_reset" of property twice, and set pdata->reg_init[idx]->warm_reset twice. Read and set it once is enough. Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c |5 - 1 file changed, 5 deletions(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index cbaf226..cde13bb 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -568,11 +568,6 @@ static void palmas_dt_to_pdata(struct device *dev, pdata->reg_init[idx]->mode_sleep = prop; ret = of_property_read_u32(palmas_matches[idx].of_node, - "ti,warm_reset", &prop); - if (!ret) - pdata->reg_init[idx]->warm_reset = prop; - - ret = of_property_read_u32(palmas_matches[idx].of_node, "ti,tstep", &prop); if (!ret) pdata->reg_init[idx]->tstep = prop; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/3] regulator: s5m8767: Use of_get_child_count()
Signed-off-by: Axel Lin --- drivers/regulator/s5m8767.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 1250cef..194b5dd 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -536,9 +536,7 @@ static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, } /* count the number of regulators to be supported in pmic */ - pdata->num_regulators = 0; - for_each_child_of_node(regulators_np, reg_np) - pdata->num_regulators++; + pdata->num_regulators = of_get_child_count(regulators_np); rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * pdata->num_regulators, GFP_KERNEL); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/3] regulator: s5m8767: Fix using wrong dev argument at various places
Use &pdev->dev rather than iodev->dev for dev_err(), dev_warn() and dev_info(). Use &pdev->dev rather than iodev->dev for devm_kzalloc() and of_get_regulator_init_data(), this fixes memory leak. Signed-off-by: Axel Lin --- drivers/regulator/s5m8767.c | 47 ++- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 194b5dd..4cb65e3 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -479,7 +479,7 @@ static struct regulator_desc regulators[] = { }; #ifdef CONFIG_OF -static int s5m8767_pmic_dt_parse_dvs_gpio(struct sec_pmic_dev *iodev, +static int s5m8767_pmic_dt_parse_dvs_gpio(struct platform_device *pdev, struct sec_platform_data *pdata, struct device_node *pmic_np) { @@ -489,7 +489,7 @@ static int s5m8767_pmic_dt_parse_dvs_gpio(struct sec_pmic_dev *iodev, gpio = of_get_named_gpio(pmic_np, "s5m8767,pmic-buck-dvs-gpios", i); if (!gpio_is_valid(gpio)) { - dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio); + dev_err(&pdev->dev, "invalid gpio[%d]: %d\n", i, gpio); return -EINVAL; } pdata->buck_gpios[i] = gpio; @@ -497,7 +497,7 @@ static int s5m8767_pmic_dt_parse_dvs_gpio(struct sec_pmic_dev *iodev, return 0; } -static int s5m8767_pmic_dt_parse_ds_gpio(struct sec_pmic_dev *iodev, +static int s5m8767_pmic_dt_parse_ds_gpio(struct platform_device *pdev, struct sec_platform_data *pdata, struct device_node *pmic_np) { @@ -507,7 +507,7 @@ static int s5m8767_pmic_dt_parse_ds_gpio(struct sec_pmic_dev *iodev, gpio = of_get_named_gpio(pmic_np, "s5m8767,pmic-buck-ds-gpios", i); if (!gpio_is_valid(gpio)) { - dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio); + dev_err(&pdev->dev, "invalid gpio[%d]: %d\n", i, gpio); return -EINVAL; } pdata->buck_ds[i] = gpio; @@ -515,9 +515,10 @@ static int s5m8767_pmic_dt_parse_ds_gpio(struct sec_pmic_dev *iodev, return 0; } -static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, +static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, struct sec_platform_data *pdata) { + struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); struct device_node *pmic_np, *regulators_np, *reg_np; struct sec_regulator_data *rdata; struct sec_opmode_data *rmode; @@ -525,31 +526,31 @@ static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, pmic_np = iodev->dev->of_node; if (!pmic_np) { - dev_err(iodev->dev, "could not find pmic sub-node\n"); + dev_err(&pdev->dev, "could not find pmic sub-node\n"); return -ENODEV; } regulators_np = of_find_node_by_name(pmic_np, "regulators"); if (!regulators_np) { - dev_err(iodev->dev, "could not find regulators sub-node\n"); + dev_err(&pdev->dev, "could not find regulators sub-node\n"); return -EINVAL; } /* count the number of regulators to be supported in pmic */ pdata->num_regulators = of_get_child_count(regulators_np); - rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * + rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * pdata->num_regulators, GFP_KERNEL); if (!rdata) { - dev_err(iodev->dev, + dev_err(&pdev->dev, "could not allocate memory for regulator data\n"); return -ENOMEM; } - rmode = devm_kzalloc(iodev->dev, sizeof(*rmode) * + rmode = devm_kzalloc(&pdev->dev, sizeof(*rmode) * pdata->num_regulators, GFP_KERNEL); if (!rdata) { - dev_err(iodev->dev, + dev_err(&pdev->dev, "could not allocate memory for regulator mode\n"); return -ENOMEM; } @@ -562,7 +563,7 @@ static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, break; if (i == ARRAY_SIZE(regulators)) { - dev_warn(iodev->dev, + dev_warn(&pdev->dev, "don't know how to configure
[PATCH 3/3] regulator: s5m8767: Prevent possible NULL pointer dereference
s5m8767_pmic_dt_parse_pdata dereferenes pdata, thus check pdata earlier to avoid NULL pointer dereference. Signed-off-by: Axel Lin --- drivers/regulator/s5m8767.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 4cb65e3..0349358 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -659,17 +659,17 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) struct s5m8767_info *s5m8767; int i, ret, size, buck_init; + if (!pdata) { + dev_err(&pdev->dev, "Platform data not supplied\n"); + return -ENODEV; + } + if (iodev->dev->of_node) { ret = s5m8767_pmic_dt_parse_pdata(pdev, pdata); if (ret) return ret; } - if (!pdata) { - dev_err(&pdev->dev, "Platform data not supplied\n"); - return -ENODEV; - } - if (pdata->buck2_gpiodvs) { if (pdata->buck3_gpiodvs || pdata->buck4_gpiodvs) { dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n"); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] regulator: core: Optimize _regulator_do_set_voltage if voltage does not change
Optimize _regulator_do_set_voltage() for the case selector is equal to old_selector. Since the voltage does not change, we don't need to call set_voltage_sel() and set_voltage_time_sel() in this case. Signed-off-by: Axel Lin --- drivers/regulator/core.c |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index de47880..e9df76e 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2239,8 +2239,11 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, best_val = rdev->desc->ops->list_voltage(rdev, ret); if (min_uV <= best_val && max_uV >= best_val) { selector = ret; - ret = rdev->desc->ops->set_voltage_sel(rdev, - ret); + if (old_selector == selector) + ret = 0; + else + ret = rdev->desc->ops->set_voltage_sel( + rdev, ret); } else { ret = -EINVAL; } @@ -2251,7 +2254,7 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, /* Call set_voltage_time_sel if successfully obtained old_selector */ if (ret == 0 && _regulator_is_enabled(rdev) && old_selector >= 0 && - rdev->desc->ops->set_voltage_time_sel) { + old_selector != selector && rdev->desc->ops->set_voltage_time_sel) { delay = rdev->desc->ops->set_voltage_time_sel(rdev, old_selector, selector); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] regulator: max8998: Let regulator core handle the case selector == old_selector
Signed-off-by: Axel Lin --- drivers/regulator/max8998.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c index 0a8dd1c..b588f07 100644 --- a/drivers/regulator/max8998.c +++ b/drivers/regulator/max8998.c @@ -311,25 +311,13 @@ static int max8998_set_voltage_buck_sel(struct regulator_dev *rdev, dev_get_platdata(max8998->iodev->dev); struct i2c_client *i2c = max8998->iodev->i2c; int buck = rdev_get_id(rdev); - int reg, shift = 0, mask, ret; - int j, previous_sel; + int reg, shift = 0, mask, ret, j; static u8 buck1_last_val; ret = max8998_get_voltage_register(rdev, ®, &shift, &mask); if (ret) return ret; - previous_sel = max8998_get_voltage_sel(rdev); - - /* Check if voltage needs to be changed */ - /* if previous_voltage equal new voltage, return */ - if (previous_sel == selector) { - dev_dbg(max8998->dev, "No voltage change, old:%d, new:%d\n", - regulator_list_voltage_linear(rdev, previous_sel), - regulator_list_voltage_linear(rdev, selector)); - return ret; - } - switch (buck) { case MAX8998_BUCK1: dev_dbg(max8998->dev, -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] mfd: max8997: Return proper error if pdata is NULL
Return proper error instead of 0 if pdata is NULL. Signed-off-by: Axel Lin --- drivers/mfd/max8997.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c index 1471405..823f34b 100644 --- a/drivers/mfd/max8997.c +++ b/drivers/mfd/max8997.c @@ -209,8 +209,10 @@ static int max8997_i2c_probe(struct i2c_client *i2c, } } - if (!pdata) + if (!pdata) { + ret = -EINVAL; goto err; + } max8997->pdata = pdata; max8997->ono = pdata->ono; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/3] regulator: s5m8767: Fix using wrong dev argument at various places
2013/2/8, Mark Brown : > On Wed, Feb 06, 2013 at 10:56:52AM +0800, Axel Lin wrote: > >> Use &pdev->dev rather than iodev->dev for dev_err(), dev_warn() and >> dev_info(). > > It's not clear to me that this is actually an improvement, the pdev is > mostly just an internal Linux implementation detail so it's common to > use the physical device for MFD logging in order to help the user > understand what's causing the log message. My understanding is if people (at least it's me) found some error message in dmesg, they usually grep the driver that emit the error message. If we use the parent device here, people might grep wrong files. > >> Use &pdev->dev rather than iodev->dev for devm_kzalloc() and >> of_get_regulator_init_data(), this fixes memory leak. > > This is a good fix though. This sort of thing is one reason for > splitting out unrelated changes. Ok. I'll resend the patchs (for one topic a patch) a few days latter. (It's Chinese New Year vacation in Taiwan now.) -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] regulator: s5m8767: Fix dev argument for devm_kzalloc and of_get_regulator_init_data
Use &pdev->dev rather than iodev->dev for devm_kzalloc() and of_get_regulator_init_data(), this fixes memory leak. Signed-off-by: Axel Lin --- drivers/regulator/s5m8767.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 194b5dd..ef0532d 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -515,9 +515,10 @@ static int s5m8767_pmic_dt_parse_ds_gpio(struct sec_pmic_dev *iodev, return 0; } -static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, +static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, struct sec_platform_data *pdata) { + struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); struct device_node *pmic_np, *regulators_np, *reg_np; struct sec_regulator_data *rdata; struct sec_opmode_data *rmode; @@ -538,7 +539,7 @@ static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, /* count the number of regulators to be supported in pmic */ pdata->num_regulators = of_get_child_count(regulators_np); - rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * + rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * pdata->num_regulators, GFP_KERNEL); if (!rdata) { dev_err(iodev->dev, @@ -546,7 +547,7 @@ static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, return -ENOMEM; } - rmode = devm_kzalloc(iodev->dev, sizeof(*rmode) * + rmode = devm_kzalloc(&pdev->dev, sizeof(*rmode) * pdata->num_regulators, GFP_KERNEL); if (!rdata) { dev_err(iodev->dev, @@ -570,7 +571,7 @@ static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, rdata->id = i; rdata->initdata = of_get_regulator_init_data( - iodev->dev, reg_np); + &pdev->dev, reg_np); rdata->reg_node = reg_np; rdata++; rmode->id = i; @@ -642,7 +643,7 @@ static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, return 0; } #else -static int s5m8767_pmic_dt_parse_pdata(struct sec_pmic_dev *iodev, +static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, struct sec_platform_data *pdata) { return 0; @@ -659,7 +660,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) int i, ret, size, buck_init; if (iodev->dev->of_node) { - ret = s5m8767_pmic_dt_parse_pdata(iodev, pdata); + ret = s5m8767_pmic_dt_parse_pdata(pdev, pdata); if (ret) return ret; } -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] regulator: s5m8767: Prevent possible NULL pointer dereference
s5m8767_pmic_dt_parse_pdata dereferenes pdata, thus check pdata earlier to avoid NULL pointer dereference. Signed-off-by: Axel Lin --- drivers/regulator/s5m8767.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index ef0532d..8a83194 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -659,17 +659,17 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) struct s5m8767_info *s5m8767; int i, ret, size, buck_init; + if (!pdata) { + dev_err(pdev->dev.parent, "Platform data not supplied\n"); + return -ENODEV; + } + if (iodev->dev->of_node) { ret = s5m8767_pmic_dt_parse_pdata(pdev, pdata); if (ret) return ret; } - if (!pdata) { - dev_err(pdev->dev.parent, "Platform data not supplied\n"); - return -ENODEV; - } - if (pdata->buck2_gpiodvs) { if (pdata->buck3_gpiodvs || pdata->buck4_gpiodvs) { dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n"); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: as3711: Fix checking if no platform initialization data
To skip registering regulator if no platform initialization data, we should check reg_data rather than ri->desc.name. Signed-off-by: Axel Lin --- drivers/regulator/as3711-regulator.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/as3711-regulator.c b/drivers/regulator/as3711-regulator.c index 2f1341d..f0ba8c4 100644 --- a/drivers/regulator/as3711-regulator.c +++ b/drivers/regulator/as3711-regulator.c @@ -303,7 +303,7 @@ static int as3711_regulator_probe(struct platform_device *pdev) reg_data = pdata ? pdata->init_data[id] : NULL; /* No need to register if there is no regulator data */ - if (!ri->desc.name) + if (!reg_data) continue; reg = ®s[id]; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: ab8500-ext: Don't update info->is_enabled if write to register fails
Signed-off-by: Axel Lin --- drivers/regulator/ab8500-ext.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c index 21b9bfb..7923e82 100644 --- a/drivers/regulator/ab8500-ext.c +++ b/drivers/regulator/ab8500-ext.c @@ -72,9 +72,11 @@ static int enable(struct ab8500_ext_regulator_info *info, u8 *regval) ret = abx500_mask_and_set_register_interruptible(info->dev, info->update_bank, info->update_reg, info->update_mask, *regval); - if (ret < 0) + if (ret < 0) { dev_err(rdev_get_dev(info->rdev), "couldn't set enable bits for regulator\n"); + return ret; + } info->is_enabled = true; @@ -117,9 +119,11 @@ static int disable(struct ab8500_ext_regulator_info *info, u8 *regval) ret = abx500_mask_and_set_register_interruptible(info->dev, info->update_bank, info->update_reg, info->update_mask, *regval); - if (ret < 0) + if (ret < 0) { dev_err(rdev_get_dev(info->rdev), "couldn't set disable bits for regulator\n"); + return ret; + } info->is_enabled = false; -- 1.7.10.4 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: dbx500-prcmu: Remove operating_point from struct dbx500_regulator_info
operating_point is not used since the initial commit of db8500-prcmu driver, remove it. Signed-off-by: Axel Lin --- drivers/regulator/dbx500-prcmu.h |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/regulator/dbx500-prcmu.h b/drivers/regulator/dbx500-prcmu.h index e763883..c8e51ac 100644 --- a/drivers/regulator/dbx500-prcmu.h +++ b/drivers/regulator/dbx500-prcmu.h @@ -21,7 +21,6 @@ * @is_enabled: status of the regulator * @epod_id: id for EPOD (power domain) * @is_ramret: RAM retention switch for EPOD (power domain) - * @operating_point: operating point (only for vape, to be removed) * */ struct dbx500_regulator_info { @@ -32,7 +31,6 @@ struct dbx500_regulator_info { u16 epod_id; bool is_ramret; bool exclude_from_power_state; - unsigned int operating_point; }; void power_state_active_enable(void); -- 1.7.10.4 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RFT] regulator: ab8500: Fix build error
2013/4/2 Mark Brown : > On Tue, Apr 02, 2013 at 08:39:53AM +0800, Axel Lin wrote: >> This patch removes 'delay' field which does not exist in struct >> ab8500_regulator_info. ( The 'delay' field was removed because fixed >> regulator >> does not need to implement set_voltage_time_sel. ) >> Fix missing semicolon and declare match_size to fix below build error. >> Also setup match pointer and match_size for ab8505 and ab8540. > > Lee? Hi, This patch does not apply to regulator tree now. I'm sending another patch serial to fix build error. 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/4] regulator: ab8500: Remove set_voltage_time_sel and delay to fix build error
The delay field is removed from struct ab8500_regulator_info in commit 29234928 "regulator: ab8500: Remove set_voltage_time_sel and delay setting". In additional, current delay setting does not make sense at all. ab8500_regulator_mode_ops is for fixed voltage only, which does not need set_voltage_time_sel. All ab8540_aux3_regulator_volt_mode_ops users do not have delay settings so set_voltage_time_sel actually returns 0. Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index ef12d3d..abdfbd4 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -633,15 +633,6 @@ static int ab8540_aux3_regulator_set_voltage_sel(struct regulator_dev *rdev, return ret; } -static int ab8500_regulator_set_voltage_time_sel(struct regulator_dev *rdev, -unsigned int old_sel, -unsigned int new_sel) -{ - struct ab8500_regulator_info *info = rdev_get_drvdata(rdev); - - return info->delay; -} - static struct regulator_ops ab8500_regulator_volt_mode_ops = { .enable = ab8500_regulator_enable, .disable= ab8500_regulator_disable, @@ -664,7 +655,6 @@ static struct regulator_ops ab8540_aux3_regulator_volt_mode_ops = { .get_voltage_sel = ab8540_aux3_regulator_get_voltage_sel, .set_voltage_sel = ab8540_aux3_regulator_set_voltage_sel, .list_voltage = regulator_list_voltage_table, - .set_voltage_time_sel = ab8500_regulator_set_voltage_time_sel, }; static struct regulator_ops ab8500_regulator_volt_ops = { @@ -674,7 +664,6 @@ static struct regulator_ops ab8500_regulator_volt_ops = { .get_voltage_sel = ab8500_regulator_get_voltage_sel, .set_voltage_sel = ab8500_regulator_set_voltage_sel, .list_voltage = regulator_list_voltage_table, - .set_voltage_time_sel = ab8500_regulator_set_voltage_time_sel, }; static struct regulator_ops ab8500_regulator_mode_ops = { @@ -1092,7 +1081,6 @@ static struct ab8500_regulator_info .n_voltages = 1, .volt_table = fixed_200_voltage, }, - .delay = 1, .load_lp_uA = 1000, .update_bank= 0x03, .update_reg = 0x80, @@ -1357,7 +1345,6 @@ static struct ab8500_regulator_info .n_voltages = 1, .volt_table = fixed_200_voltage, }, - .delay = 1, .load_lp_uA = 1000, .update_bank= 0x03, .update_reg = 0x80, @@ -1606,7 +1593,6 @@ static struct ab8500_regulator_info .owner = THIS_MODULE, .n_voltages = 1, }, - .delay = 1, .load_lp_uA = 1000, .update_bank= 0x03, .update_reg = 0x80, -- 1.7.10.4 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/4] regulator: ab8500: Remove voltages and voltages_len to fix build error
Both voltages and voltages_len are not exist in struct ab8500_regulator_info. Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index abdfbd4..bdd17e6 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -1124,8 +1124,6 @@ static struct ab8500_regulator_info .voltage_reg= 0x57, .voltage_mask = 0x7, .voltage_shift = 4, - .voltages = ldo_vaudio_voltages, - .voltages_len = ARRAY_SIZE(ldo_vaudio_voltages), }, [AB8505_LDO_ANAMIC1] = { .desc = { @@ -1207,8 +1205,6 @@ static struct ab8500_regulator_info .voltage_bank = 0x04, .voltage_reg= 0x29, .voltage_mask = 0x7, - .voltages = ldo_vana_voltages, - .voltages_len = ARRAY_SIZE(ldo_vana_voltages), }, }; @@ -1666,6 +1662,7 @@ static struct ab8500_regulator_info .id = AB8540_LDO_DMIC, .owner = THIS_MODULE, .n_voltages = ARRAY_SIZE(ldo_vdmic_voltages), + .volt_table = ldo_vdmic_voltages, }, .load_lp_uA = 1000, .update_bank= 0x03, @@ -1675,8 +1672,6 @@ static struct ab8500_regulator_info .voltage_bank = 0x03, .voltage_reg= 0x83, .voltage_mask = 0xc0, - .voltages = ldo_vdmic_voltages, - .voltages_len = ARRAY_SIZE(ldo_vdmic_voltages), }, /* -- 1.7.10.4 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/4] regulator: ab8500: Fix 'match_size' undeclared and missing semicolon
Fix below build errors: CC drivers/regulator/ab8500.o drivers/regulator/ab8500.c: In function 'ab8500_regulator_probe': drivers/regulator/ab8500.c:3018:3: error: 'match_size' undeclared (first use in this function) drivers/regulator/ab8500.c:3018:3: note: each undeclared identifier is reported only once for each function it appears in drivers/regulator/ab8500.c:3019:2: error: expected ';' before '}' token drivers/regulator/ab8500.c:3036:2: error: expected ';' before '}' token Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index bdd17e6..73d84d8 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -3007,7 +3007,7 @@ static int ab8500_regulator_probe(struct platform_device *pdev) struct ab8500_regulator_info *regulator_info; int regulator_info_size; struct ab8500_reg_init *reg_init; - int reg_init_size; + int reg_init_size, match_size; if (is_ab9540(ab8500)) { regulator_info = ab9540_regulator_info; @@ -3015,7 +3015,7 @@ static int ab8500_regulator_probe(struct platform_device *pdev) reg_init = ab9540_reg_init; reg_init_size = AB9540_NUM_REGULATOR_REGISTERS; match = ab9540_regulator_match; - match_size = ARRAY_SIZE(ab9540_regulator_match) + match_size = ARRAY_SIZE(ab9540_regulator_match); } else if (is_ab8505(ab8500)) { regulator_info = ab8505_regulator_info; regulator_info_size = ARRAY_SIZE(ab8505_regulator_info); @@ -3032,7 +3032,7 @@ static int ab8500_regulator_probe(struct platform_device *pdev) reg_init = ab8500_reg_init; reg_init_size = AB8500_NUM_REGULATOR_REGISTERS; match = ab8500_regulator_match; - match_size = ARRAY_SIZE(ab8500_regulator_match) + match_size = ARRAY_SIZE(ab8500_regulator_match); } if (np) { -- 1.7.10.4 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/4] regulator: ab8500: Set match pointer and match_size for ab8505 and ab8540
Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index 73d84d8..d3170ae 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -3021,11 +3021,15 @@ static int ab8500_regulator_probe(struct platform_device *pdev) regulator_info_size = ARRAY_SIZE(ab8505_regulator_info); reg_init = ab8505_reg_init; reg_init_size = AB8505_NUM_REGULATOR_REGISTERS; + match = ab8505_regulator_match; + match_size = ARRAY_SIZE(ab8505_regulator_match); } else if (is_ab8540(ab8500)) { regulator_info = ab8540_regulator_info; regulator_info_size = ARRAY_SIZE(ab8540_regulator_info); reg_init = ab8540_reg_init; reg_init_size = AB8540_NUM_REGULATOR_REGISTERS; + match = ab8540_regulator_match; + match_size = ARRAY_SIZE(ab8540_regulator_match); } else { regulator_info = ab8500_regulator_info; regulator_info_size = ARRAY_SIZE(ab8500_regulator_info); -- 1.7.10.4 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/4] regulator: ab8500: Remove set_voltage_time_sel and delay to fix build error
2013/4/4 Mark Brown : > On Wed, Apr 03, 2013 at 10:30:43AM +0800, Axel Lin wrote: >> The delay field is removed from struct ab8500_regulator_info in commit >> 29234928 >> "regulator: ab8500: Remove set_voltage_time_sel and delay setting". > > I've now finished applying all Lee's outstanding patches (which weren't > sent to the list...) - could you please recheck if the first two of > these patches are still revlevant and that the last two are addressed > properly as per Lee's mails? Thanks. Yes, it looks ok now except ab8500_regulator_set_voltage_time_sel() is not useful because it always return 0. -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: ab8500: Remove ab8500_regulator_set_voltage_time_sel
All users of ab8500_regulator_volt_mode_ops and ab8500_regulator_volt_ops do not set info->desc.enable_time, thus set_voltage_time_sel() always returns 0. Remove it. Signed-off-by: Axel Lin --- drivers/regulator/ab8500.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index a8552a5..517305e 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -648,15 +648,6 @@ static int ab8540_aux3_regulator_set_voltage_sel(struct regulator_dev *rdev, return ret; } -static int ab8500_regulator_set_voltage_time_sel(struct regulator_dev *rdev, -unsigned int old_sel, -unsigned int new_sel) -{ - struct ab8500_regulator_info *info = rdev_get_drvdata(rdev); - - return info->desc.enable_time; -} - static struct regulator_ops ab8500_regulator_volt_mode_ops = { .enable = ab8500_regulator_enable, .disable= ab8500_regulator_disable, @@ -679,7 +670,6 @@ static struct regulator_ops ab8540_aux3_regulator_volt_mode_ops = { .get_voltage_sel = ab8540_aux3_regulator_get_voltage_sel, .set_voltage_sel = ab8540_aux3_regulator_set_voltage_sel, .list_voltage = regulator_list_voltage_table, - .set_voltage_time_sel = ab8500_regulator_set_voltage_time_sel, }; static struct regulator_ops ab8500_regulator_volt_ops = { @@ -689,7 +679,6 @@ static struct regulator_ops ab8500_regulator_volt_ops = { .get_voltage_sel = ab8500_regulator_get_voltage_sel, .set_voltage_sel = ab8500_regulator_set_voltage_sel, .list_voltage = regulator_list_voltage_table, - .set_voltage_time_sel = ab8500_regulator_set_voltage_time_sel, }; static struct regulator_ops ab8500_regulator_mode_ops = { -- 1.7.10.4 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: tps65090: Fix using wrong dev argument for calling of_regulator_match
The dev parameter is the device requesting the data. In this case it should be &pdev->dev rather than pdev->dev.parent. The dev parameter is used to call devm_kzalloc in of_get_regulator_init_data(), which means this fixes a memory leak because the memory is allocated every time probe() is called, thus it should be freed when this driver is unloaded. Signed-off-by: Axel Lin --- drivers/regulator/tps65090-regulator.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c index 8687543..c8e7045 100644 --- a/drivers/regulator/tps65090-regulator.c +++ b/drivers/regulator/tps65090-regulator.c @@ -186,7 +186,7 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data( return ERR_PTR(-ENODEV); } - ret = of_regulator_match(pdev->dev.parent, regulators, tps65090_matches, + ret = of_regulator_match(&pdev->dev, regulators, tps65090_matches, ARRAY_SIZE(tps65090_matches)); if (ret < 0) { dev_err(&pdev->dev, -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] regulator: max8997: Use of_get_child_count()
Signed-off-by: Axel Lin --- drivers/regulator/max8997.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 7d2b1b5..c780104 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c @@ -930,9 +930,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, } /* count the number of regulators to be supported in pmic */ - pdata->num_regulators = 0; - for_each_child_of_node(regulators_np, reg_np) - pdata->num_regulators++; + pdata->num_regulators = of_get_child_count(regulators_np); rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * pdata->num_regulators, GFP_KERNEL); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] regulator: mc13xxx: Use of_get_child_count()
Signed-off-by: Axel Lin --- hi Mark, I generate this patch against for-next branch of regulator tree. So this patch is on top of commit c92f5dd2c "regulator: Add missing of_node_put()". Which means it can only be applied to topic/of branch now. If you prefer apply it to other branch, I can resend and generate the patch against proper topic branch. Axel drivers/regulator/mc13xxx-regulator-core.c |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c index 04cf962..5186adc 100644 --- a/drivers/regulator/mc13xxx-regulator-core.c +++ b/drivers/regulator/mc13xxx-regulator-core.c @@ -164,17 +164,15 @@ EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_ops); #ifdef CONFIG_OF int mc13xxx_get_num_regulators_dt(struct platform_device *pdev) { - struct device_node *parent, *child; - int num = 0; + struct device_node *parent; + int num; of_node_get(pdev->dev.parent->of_node); parent = of_find_node_by_name(pdev->dev.parent->of_node, "regulators"); if (!parent) return -ENODEV; - for_each_child_of_node(parent, child) - num++; - + num = of_get_child_count(parent); of_node_put(parent); return num; } -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regmap: Export regmap_async_complete_cb
This fixes below build error when CONFIG_REGMAP=y && CONFIG_REGMAP_SPI=m ERROR: "regmap_async_complete_cb" [drivers/base/regmap/regmap-spi.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 Signed-off-by: Axel Lin --- drivers/base/regmap/regmap.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index bee8560..9a516b8b 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1655,6 +1655,7 @@ void regmap_async_complete_cb(struct regmap_async *async, int ret) if (wake) wake_up(&map->async_waitq); } +EXPORT_SYMBOL_GPL(regmap_async_complete_cb); static int regmap_async_is_done(struct regmap *map) { -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/3] regulator: max8907: Fix using wrong dev argument for calling of_regulator_match
The dev parameter is the device requesting the data. In this case it should be &pdev->dev rather than pdev->dev.parent. The dev parameter is used to call devm_kzalloc in of_get_regulator_init_data(), which means this fixes a memory leak because the memory is allocated every time probe() is called, thus it should be freed when this driver is unloaded. Signed-off-by: Axel Lin --- drivers/regulator/max8907-regulator.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c index d1a7751..d40cf7f 100644 --- a/drivers/regulator/max8907-regulator.c +++ b/drivers/regulator/max8907-regulator.c @@ -237,8 +237,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev) return -EINVAL; } - ret = of_regulator_match(pdev->dev.parent, regulators, -max8907_matches, + ret = of_regulator_match(&pdev->dev, regulators, max8907_matches, ARRAY_SIZE(max8907_matches)); if (ret < 0) { dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/3] regulator: max77686: Fix using wrong dev argument at various places
Use &pdev->dev rather than iodev->dev for dev_err(). Use &pdev->dev rather than iodev->dev for devm_kzalloc() and of_regulator_match(), this fixes memory leak. Signed-off-by: Axel Lin --- drivers/regulator/max77686.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c index b85040c..cca18a3 100644 --- a/drivers/regulator/max77686.c +++ b/drivers/regulator/max77686.c @@ -379,9 +379,10 @@ static struct regulator_desc regulators[] = { }; #ifdef CONFIG_OF -static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, +static int max77686_pmic_dt_parse_pdata(struct platform_device *pdev, struct max77686_platform_data *pdata) { + struct max77686_dev *iodev = dev_get_drvdata(pdev->dev.parent); struct device_node *pmic_np, *regulators_np; struct max77686_regulator_data *rdata; struct of_regulator_match rmatch; @@ -390,15 +391,15 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, pmic_np = iodev->dev->of_node; regulators_np = of_find_node_by_name(pmic_np, "voltage-regulators"); if (!regulators_np) { - dev_err(iodev->dev, "could not find regulators sub-node\n"); + dev_err(&pdev->dev, "could not find regulators sub-node\n"); return -EINVAL; } pdata->num_regulators = ARRAY_SIZE(regulators); - rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * + rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * pdata->num_regulators, GFP_KERNEL); if (!rdata) { - dev_err(iodev->dev, + dev_err(&pdev->dev, "could not allocate memory for regulator data\n"); return -ENOMEM; } @@ -407,7 +408,7 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, rmatch.name = regulators[i].name; rmatch.init_data = NULL; rmatch.of_node = NULL; - of_regulator_match(iodev->dev, regulators_np, &rmatch, 1); + of_regulator_match(&pdev->dev, regulators_np, &rmatch, 1); rdata[i].initdata = rmatch.init_data; rdata[i].of_node = rmatch.of_node; } @@ -417,7 +418,7 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, return 0; } #else -static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, +static int max77686_pmic_dt_parse_pdata(struct platform_device *pdev, struct max77686_platform_data *pdata) { return 0; @@ -440,7 +441,7 @@ static int max77686_pmic_probe(struct platform_device *pdev) } if (iodev->dev->of_node) { - ret = max77686_pmic_dt_parse_pdata(iodev, pdata); + ret = max77686_pmic_dt_parse_pdata(pdev, pdata); if (ret) return ret; } -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/3] regulator: max8997: Fix using wrong dev argument at various places
Use &pdev->dev rather than iodev->dev for dev_err(), dev_warn() and dev_info(). Use &pdev->dev rather than iodev->dev for devm_kzalloc() and of_get_regulator_init_data(), this fixes memory leak. Signed-off-by: Axel Lin --- drivers/regulator/max8997.c | 39 +++ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 1a1ae99..5556a15 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c @@ -891,7 +891,7 @@ static struct regulator_desc regulators[] = { }; #ifdef CONFIG_OF -static int max8997_pmic_dt_parse_dvs_gpio(struct max8997_dev *iodev, +static int max8997_pmic_dt_parse_dvs_gpio(struct platform_device *pdev, struct max8997_platform_data *pdata, struct device_node *pmic_np) { @@ -901,7 +901,7 @@ static int max8997_pmic_dt_parse_dvs_gpio(struct max8997_dev *iodev, gpio = of_get_named_gpio(pmic_np, "max8997,pmic-buck125-dvs-gpios", i); if (!gpio_is_valid(gpio)) { - dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio); + dev_err(&pdev->dev, "invalid gpio[%d]: %d\n", i, gpio); return -EINVAL; } pdata->buck125_gpios[i] = gpio; @@ -909,22 +909,23 @@ static int max8997_pmic_dt_parse_dvs_gpio(struct max8997_dev *iodev, return 0; } -static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, +static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, struct max8997_platform_data *pdata) { + struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent); struct device_node *pmic_np, *regulators_np, *reg_np; struct max8997_regulator_data *rdata; unsigned int i, dvs_voltage_nr = 1, ret; pmic_np = iodev->dev->of_node; if (!pmic_np) { - dev_err(iodev->dev, "could not find pmic sub-node\n"); + dev_err(&pdev->dev, "could not find pmic sub-node\n"); return -ENODEV; } regulators_np = of_find_node_by_name(pmic_np, "regulators"); if (!regulators_np) { - dev_err(iodev->dev, "could not find regulators sub-node\n"); + dev_err(&pdev->dev, "could not find regulators sub-node\n"); return -EINVAL; } @@ -933,11 +934,10 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, for_each_child_of_node(regulators_np, reg_np) pdata->num_regulators++; - rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * + rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * pdata->num_regulators, GFP_KERNEL); if (!rdata) { - dev_err(iodev->dev, "could not allocate memory for " - "regulator data\n"); + dev_err(&pdev->dev, "could not allocate memory for regulator data\n"); return -ENOMEM; } @@ -948,14 +948,14 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, break; if (i == ARRAY_SIZE(regulators)) { - dev_warn(iodev->dev, "don't know how to configure " - "regulator %s\n", reg_np->name); + dev_warn(&pdev->dev, "don't know how to configure regulator %s\n", +reg_np->name); continue; } rdata->id = i; - rdata->initdata = of_get_regulator_init_data( - iodev->dev, reg_np); + rdata->initdata = of_get_regulator_init_data(&pdev->dev, +reg_np); rdata->reg_node = reg_np; rdata++; } @@ -971,7 +971,7 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, if (pdata->buck1_gpiodvs || pdata->buck2_gpiodvs || pdata->buck5_gpiodvs) { - ret = max8997_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np); + ret = max8997_pmic_dt_parse_dvs_gpio(pdev, pdata, pmic_np); if (ret) return -EINVAL; @@ -982,8 +982,7 @@ static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, } else { if (pdata->buck125_default_idx >= 8) {
[PATCH] regulator: tps80031: Use IS_ERR to check return value of regulator_register()
regulator_register() does not return NULL, it returns ERR_PTR on error. Signed-off-by: Axel Lin --- drivers/regulator/tps80031-regulator.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/tps80031-regulator.c b/drivers/regulator/tps80031-regulator.c index b15d711..9019d0e 100644 --- a/drivers/regulator/tps80031-regulator.c +++ b/drivers/regulator/tps80031-regulator.c @@ -728,7 +728,7 @@ static int tps80031_regulator_probe(struct platform_device *pdev) } } rdev = regulator_register(&ri->rinfo->desc, &config); - if (IS_ERR_OR_NULL(rdev)) { + if (IS_ERR(rdev)) { dev_err(&pdev->dev, "register regulator failed %s\n", ri->rinfo->desc.name); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: lp8755: Use LP8755_BUCK_MAX instead of magic number
Signed-off-by: Axel Lin --- drivers/regulator/lp8755.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/lp8755.c b/drivers/regulator/lp8755.c index 8b1ce0f..f0f6ea0 100644 --- a/drivers/regulator/lp8755.c +++ b/drivers/regulator/lp8755.c @@ -373,7 +373,7 @@ static irqreturn_t lp8755_irq_handler(int irq, void *data) goto err_i2c; /* sent power fault detection event to specific regulator */ - for (icnt = 0; icnt < 6; icnt++) + for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++) if ((flag0 & (0x4 << icnt)) && (pchip->irqmask & (0x04 << icnt)) && (pchip->rdev[icnt] != NULL)) @@ -508,7 +508,7 @@ err_irq: err_regulator: /* output disable */ - for (icnt = 0; icnt < 0x06; icnt++) + for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++) lp8755_write(pchip, icnt, 0x00); return ret; @@ -522,7 +522,7 @@ static int lp8755_remove(struct i2c_client *client) for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++) regulator_unregister(pchip->rdev[icnt]); - for (icnt = 0; icnt < 0x06; icnt++) + for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++) lp8755_write(pchip, icnt, 0x00); if (pchip->irq != 0) -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: Add missing of_node_put()
of_find_node_by_name() returns a node pointer with refcount incremented, use of_node_put() on it when done. Signed-off-by: Axel Lin Cc: Haojian Zhuang Cc: David Dajun Chen Cc: Gyungoh Yoo Cc: MyungJoo Ham Cc: Graeme Gregory Cc: Laxman Dewangan Cc: Shawn Guo --- Hi, I don't have these hardware, only compile test. Axel drivers/regulator/88pm8607.c |1 + drivers/regulator/da9052-regulator.c |1 + drivers/regulator/max8907-regulator.c |1 + drivers/regulator/max8925-regulator.c |1 + drivers/regulator/max8997.c|2 ++ drivers/regulator/mc13xxx-regulator-core.c |1 + drivers/regulator/palmas-regulator.c |1 + drivers/regulator/tps65910-regulator.c |2 ++ 8 files changed, 10 insertions(+) diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index a957e8c..a84048a 100644 --- a/drivers/regulator/88pm8607.c +++ b/drivers/regulator/88pm8607.c @@ -363,6 +363,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev, break; } } + of_node_put(nproot); return 0; } #else diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index c6d8651..fe06ff6 100644 --- a/drivers/regulator/da9052-regulator.c +++ b/drivers/regulator/da9052-regulator.c @@ -385,6 +385,7 @@ static int da9052_regulator_probe(struct platform_device *pdev) break; } } + of_node_put(nproot); #endif } diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c index d40cf7f..dccf9ff 100644 --- a/drivers/regulator/max8907-regulator.c +++ b/drivers/regulator/max8907-regulator.c @@ -239,6 +239,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev) ret = of_regulator_match(&pdev->dev, regulators, max8907_matches, ARRAY_SIZE(max8907_matches)); + of_node_put(regulators); if (ret < 0) { dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", ret); diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c index 446a854..f4f52f0 100644 --- a/drivers/regulator/max8925-regulator.c +++ b/drivers/regulator/max8925-regulator.c @@ -263,6 +263,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev, rcount = of_regulator_match(&pdev->dev, np, &max8925_regulator_matches[ridx], 1); + of_node_put(np); if (rcount < 0) return -ENODEV; config->init_data = max8925_regulator_matches[ridx].init_data; diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 5556a15..7d2b1b5 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c @@ -937,6 +937,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * pdata->num_regulators, GFP_KERNEL); if (!rdata) { + of_node_put(regulators_np); dev_err(&pdev->dev, "could not allocate memory for regulator data\n"); return -ENOMEM; } @@ -959,6 +960,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, rdata->reg_node = reg_np; rdata++; } + of_node_put(regulators_np); if (of_get_property(pmic_np, "max8997,pmic-buck1-uses-gpio-dvs", NULL)) pdata->buck1_gpiodvs = true; diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c index 2ecf1d8..04cf962 100644 --- a/drivers/regulator/mc13xxx-regulator-core.c +++ b/drivers/regulator/mc13xxx-regulator-core.c @@ -175,6 +175,7 @@ int mc13xxx_get_num_regulators_dt(struct platform_device *pdev) for_each_child_of_node(parent, child) num++; + of_node_put(parent); return num; } EXPORT_SYMBOL_GPL(mc13xxx_get_num_regulators_dt); diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index c9e912f..bb6ea5e 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -535,6 +535,7 @@ static void palmas_dt_to_pdata(struct device *dev, ret = of_regulator_match(dev, regulators, palmas_matches, PALMAS_NUM_REGS); + of_node_put(regulators); if (ret < 0) { dev_err(dev, "Error parsing regulator init data: %d\n", ret); return; diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index b0e4c0b..32ca2b0 100644 --- a/drivers/regulator/tps65910-re
[PATCH] backlight: 88pm860x_bl: Add missing of_node_put()
of_find_node_by_name() returns a node pointer with refcount incremented, use of_node_put() on it when done. Signed-off-by: Axel Lin --- drivers/video/backlight/88pm860x_bl.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index c072ed9..4d2782f 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c @@ -184,6 +184,7 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev, break; } } + of_node_put(nproot); return 0; } #else -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: tps6507x: Fix using wrong dev argument for calling of_regulator_match
The dev parameter is the device requesting the data. In this case it should be &pdev->dev rather than pdev->dev.parent. The dev parameter is used to call devm_kzalloc in of_get_regulator_init_data(), which means this fixes a memory leak because the memory is allocated every time probe() is called, thus it should be freed when this driver is unloaded. Signed-off-by: Axel Lin --- drivers/regulator/tps6507x-regulator.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index afdeb65..54aa2da 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c @@ -394,7 +394,7 @@ static struct tps6507x_board *tps6507x_parse_dt_reg_data( count = ARRAY_SIZE(tps6507x_matches); matches = tps6507x_matches; - ret = of_regulator_match(pdev->dev.parent, regulators, matches, count); + ret = of_regulator_match(&pdev->dev, regulators, matches, count); if (ret < 0) { dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", ret); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFT][PATCH v2] backlight: 88pm860x_bl: Add missing of_node_put()
of_find_node_by_name() returns a node pointer with refcount incremented, use of_node_put() on it when done. of_find_node_by_name() will call of_node_put() against the node pass to from parameter, thus we also need to call of_node_get(from) before calling of_find_node_by_name(). Signed-off-by: Axel Lin --- v2: need to call of_node_get(pdev->dev.parent->of_node) before calling of_find_node_by_name(). drivers/video/backlight/88pm860x_bl.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index c072ed9..2cd6350 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c @@ -165,8 +165,10 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev, struct pm860x_backlight_data *data, char *name) { - struct device_node *nproot = pdev->dev.parent->of_node, *np; + struct device_node *nproot, *np; int iset = 0; + + nproot = of_node_get(pdev->dev.parent->of_node); if (!nproot) return -ENODEV; nproot = of_find_node_by_name(nproot, "backlights"); @@ -184,6 +186,7 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev, break; } } + of_node_put(nproot); return 0; } #else -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFT][PATCH v2] regulator: Add missing of_node_put()
of_find_node_by_name() returns a node pointer with refcount incremented, use of_node_put() on it when done. of_find_node_by_name() will call of_node_put() against from parameter, thus we also need to call of_node_get(from) before calling of_find_node_by_name(). Signed-off-by: Axel Lin Cc: Haojian Zhuang Cc: David Dajun Chen Cc: Gyungoh Yoo Cc: MyungJoo Ham Cc: Graeme Gregory Cc: Laxman Dewangan Cc: Shawn Guo --- v2: need to call of_node_get() for the node to start searching from before calling of_find_node_by_name(). drivers/regulator/88pm8607.c |3 ++- drivers/regulator/da9052-regulator.c |5 +++-- drivers/regulator/max8907-regulator.c |7 --- drivers/regulator/max8925-regulator.c |3 ++- drivers/regulator/max8997.c|4 +++- drivers/regulator/mc13xxx-regulator-core.c |7 ++- drivers/regulator/palmas-regulator.c |2 ++ drivers/regulator/tps65910-regulator.c |6 -- 8 files changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index a957e8c..c79ab84 100644 --- a/drivers/regulator/88pm8607.c +++ b/drivers/regulator/88pm8607.c @@ -347,7 +347,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev, struct regulator_config *config) { struct device_node *nproot, *np; - nproot = pdev->dev.parent->of_node; + nproot = of_node_get(pdev->dev.parent->of_node); if (!nproot) return -ENODEV; nproot = of_find_node_by_name(nproot, "regulators"); @@ -363,6 +363,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev, break; } } + of_node_put(nproot); return 0; } #else diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index c6d8651..96b569a 100644 --- a/drivers/regulator/da9052-regulator.c +++ b/drivers/regulator/da9052-regulator.c @@ -366,9 +366,9 @@ static int da9052_regulator_probe(struct platform_device *pdev) config.init_data = pdata->regulators[pdev->id]; } else { #ifdef CONFIG_OF - struct device_node *nproot = da9052->dev->of_node; - struct device_node *np; + struct device_node *nproot, *np; + nproot = of_node_get(da9052->dev->of_node); if (!nproot) return -ENODEV; @@ -385,6 +385,7 @@ static int da9052_regulator_probe(struct platform_device *pdev) break; } } + of_node_put(nproot); #endif } diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c index d40cf7f..4568c15 100644 --- a/drivers/regulator/max8907-regulator.c +++ b/drivers/regulator/max8907-regulator.c @@ -224,11 +224,11 @@ static struct of_regulator_match max8907_matches[] = { static int max8907_regulator_parse_dt(struct platform_device *pdev) { - struct device_node *np = pdev->dev.parent->of_node; - struct device_node *regulators; + struct device_node *np, *regulators; int ret; - if (!pdev->dev.parent->of_node) + np = of_node_get(pdev->dev.parent->of_node); + if (!np) return 0; regulators = of_find_node_by_name(np, "regulators"); @@ -239,6 +239,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev) ret = of_regulator_match(&pdev->dev, regulators, max8907_matches, ARRAY_SIZE(max8907_matches)); + of_node_put(regulators); if (ret < 0) { dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", ret); diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c index 446a854..0d5f64a 100644 --- a/drivers/regulator/max8925-regulator.c +++ b/drivers/regulator/max8925-regulator.c @@ -252,7 +252,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev, { struct device_node *nproot, *np; int rcount; - nproot = pdev->dev.parent->of_node; + nproot = of_node_get(pdev->dev.parent->of_node); if (!nproot) return -ENODEV; np = of_find_node_by_name(nproot, "regulators"); @@ -263,6 +263,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev, rcount = of_regulator_match(&pdev->dev, np, &max8925_regulator_matches[ridx], 1); + of_node_put(np); if (rcount < 0) return -ENODEV; config->init_data = max8925_regulator_matches[ridx].init_data; diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8
[PATCH 1/2] regulator: gpio-regulator: Use of_gpio_count()
Signed-off-by: Axel Lin --- drivers/regulator/gpio-regulator.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index bae681c..d819ba7 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c @@ -163,10 +163,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np) config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0); /* Fetch GPIOs. */ - for (i = 0; ; i++) - if (of_get_named_gpio(np, "gpios", i) < 0) - break; - config->nr_gpios = i; + config->nr_gpios = of_gpio_count(np); config->gpios = devm_kzalloc(dev, sizeof(struct gpio) * config->nr_gpios, -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] regulator: gpio-regulator: Staticize of_get_gpio_regulator_config()
of_get_gpio_regulator_config() is only used in gpio-regulator.c, make it static. Signed-off-by: Axel Lin --- drivers/regulator/gpio-regulator.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index d819ba7..9d39eb4 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c @@ -132,7 +132,7 @@ static struct regulator_ops gpio_regulator_voltage_ops = { .list_voltage = gpio_regulator_list_voltage, }; -struct gpio_regulator_config * +static struct gpio_regulator_config * of_get_gpio_regulator_config(struct device *dev, struct device_node *np) { struct gpio_regulator_config *config; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 1/4] regulator: core: support shared enable GPIO concept
> + if (pin->request_count <= 1) { > + pin->request_count = 0; > + gpio_free(pin->gpio); > + list_del(&pin->list); > + kfree(pin); > + } else { > + pin->request_count--; > + } How about change above lines to this: if (--pin->request_count == 0) { gpio_free(pin->gpio); list_del(&pin->list); kfree(pin); } -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 2/4] regulator: core: manage enable GPIO list
> +/** > + * Balance enable_count of each GPIO and actual GPIO pin control. > + * GPIO is enabled in case of initial use. (enable_count is 0) > + * GPIO is disabled when it is not shared any more. (enable_count <= 1) I think you mean "GPIO is disabled when it is not used any more." "It is not shared" sounds like it can has one user. > + */ > +static int regulator_ena_gpio_ctrl(struct regulator_dev *rdev, bool enable) > +{ > + struct regulator_enable_gpio *pin = rdev->ena_pin; > + > + if (!pin) > + return -EINVAL; > + > + if (enable) { > + /* Enable GPIO at initial use */ > + if (pin->enable_count == 0) > + gpio_set_value_cansleep(pin->gpio, > + !pin->ena_gpio_invert); > + > + pin->enable_count++; > + } else { > + if (pin->enable_count > 1) { > + pin->enable_count--; > + return 0; > + } > + > + /* Disable GPIO if not used */ > + if (pin->enable_count <= 1) { > + gpio_set_value_cansleep(pin->gpio, > + pin->ena_gpio_invert); > + pin->enable_count = 0; > + } How about: /* No action to disable if enable_count is already 0 */ if (pin->enable_count == 0) return 0; /* Disable GPIO if not used */ if (--pin->enable_count == 0) gpio_set_value_cansleep(pin->gpio, pin->ena_gpio_invert); -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 0/4] regulator: core: support shared enable GPIO
2013/2/18 Kim, Milo : > A Regulator can be enabled by external GPIO pin which is configurable in the > regulator_config. > At this moment, the GPIO can be owned by only one regulator device. > In some devices like LP8788 LDOs, multiple regulators are enabled by shared > one GPIO pin. > This patch-set enables shared enable GPIO concept and fix LP8788 LDO driver > as well. This patch serial looks good to me. You can add: Reviewed-by: Axel Lin -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] mfd: Make AB8500_CORE select POWER_SUPPLY to fix build error
This patch fixes below build error when CONFIG_POWER_SUPPLY is not set. drivers/built-in.o: In function `ab8500_power_off': drivers/mfd/ab8500-sysctrl.c:37: undefined reference to `power_supply_get_by_name' drivers/mfd/ab8500-sysctrl.c:53: undefined reference to `power_supply_get_by_name' make: *** [vmlinux] Error 1 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 671f5b1..c346941 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -858,6 +858,7 @@ config EZX_PCAP config AB8500_CORE bool "ST-Ericsson AB8500 Mixed Signal Power Management chip" depends on GENERIC_HARDIRQS && ABX500_CORE && MFD_DB8500_PRCMU + select POWER_SUPPLY select MFD_CORE select IRQ_DOMAIN help -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] regulator: tps6586x: Having slew rate settings for other than SM0/1 is not fatal
2013/2/20 Stephen Warren : > On 02/16/2013 04:50 AM, Axel Lin wrote: >> Ignore the setting and show "Only SM0/SM1 can set slew rate" warning is >> enough, >> then we can return 0 instead of -EINVAL in >> tps6586x_regulator_set_slew_rate(). >> >> Otherwise, probe() fails. > > Why does probe() fail; what is trying to set a slew rate on a regulator > that doesn't support it? At least a few days ago in linux-next, this > patch wasn't needed AFAIK. Is the problem something new? > Oh, sorry for my poor Engilish. I mean probe fails because of having slew rate settings for other than SM0/1 seems not necessary. In tps6586x_regulator_set_slew_rate() it uses dev_warn rather than dev_err for the default case. We can either using "dev_warn with return 0" or use "dev_err with return -EINVAL" in tps6586x_regulator_set_slew_rate(). It looks to me that having slew rate settings for other than SM0/1 should be ok if it actually is harmless ( because we can just ignore the setting ). BTW, I read the code but I don't have this hardware. 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: tps6586x: Use dev_err rather than dev_warn for error message
tps6586x_regulator_set_slew_rate() returns -EINVAL when having slew rate settings for other than SM0/1, thus use dev_err rather than dev_warn. Signed-off-by: Axel Lin --- drivers/regulator/tps6586x-regulator.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c index e68382d..94a681e 100644 --- a/drivers/regulator/tps6586x-regulator.c +++ b/drivers/regulator/tps6586x-regulator.c @@ -245,7 +245,7 @@ static int tps6586x_regulator_set_slew_rate(struct platform_device *pdev, reg = TPS6586X_SM1SL; break; default: - dev_warn(&pdev->dev, "Only SM0/SM1 can set slew rate\n"); + dev_err(&pdev->dev, "Only SM0/SM1 can set slew rate\n"); return -EINVAL; } -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: palmas: Use of_property_read_bool to read "ti,warm-reset" DT property
It does not make sense to assign return value of of_property_read_u32() to pdata->reg_init[idx]->warm_reset. Use of_property_read_bool() to read "ti,warm-reset" DT property instead which will return correct setting for pdata->reg_init[idx]->warm_reset. Signed-off-by: Axel Lin --- drivers/regulator/palmas-regulator.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index b2b1baa..a9b558e 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -554,8 +554,8 @@ static void palmas_dt_to_pdata(struct device *dev, sizeof(struct palmas_reg_init), GFP_KERNEL); pdata->reg_init[idx]->warm_reset = - of_property_read_u32(palmas_matches[idx].of_node, -"ti,warm-reset", &prop); + of_property_read_bool(palmas_matches[idx].of_node, +"ti,warm-reset"); pdata->reg_init[idx]->roof_floor = of_property_read_bool(palmas_matches[idx].of_node, -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] hwmon: lineage-pem: Add missing terminating entry for pem_[input|fan]_attributes
Signed-off-by: Axel Lin --- drivers/hwmon/lineage-pem.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hwmon/lineage-pem.c b/drivers/hwmon/lineage-pem.c index 41df29f..ebbb9f4 100644 --- a/drivers/hwmon/lineage-pem.c +++ b/drivers/hwmon/lineage-pem.c @@ -422,6 +422,7 @@ static struct attribute *pem_input_attributes[] = { &sensor_dev_attr_in2_input.dev_attr.attr, &sensor_dev_attr_curr1_input.dev_attr.attr, &sensor_dev_attr_power1_input.dev_attr.attr, + NULL }; static const struct attribute_group pem_input_group = { @@ -432,6 +433,7 @@ static struct attribute *pem_fan_attributes[] = { &sensor_dev_attr_fan1_input.dev_attr.attr, &sensor_dev_attr_fan2_input.dev_attr.attr, &sensor_dev_attr_fan3_input.dev_attr.attr, + NULL }; static const struct attribute_group pem_fan_group = { -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] gpio: pl061: Add pl061_gpio_free()
commit 39b70ee051 "gpio: pl061: bind pinctrl by gpio request" adds pl061_gpio_request() to request pinctrl. Thus we need to add corresponding pl061_gpio_free() to free the pin. Signed-off-by: Axel Lin --- drivers/gpio/gpio-pl061.c |8 1 file changed, 8 insertions(+) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 06ed257..d7008df 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -72,6 +72,13 @@ static int pl061_gpio_request(struct gpio_chip *chip, unsigned offset) return pinctrl_request_gpio(gpio); } +static void pl061_gpio_free(struct gpio_chip *chip, unsigned offset) +{ + int gpio = chip->base + offset; + + pinctrl_free_gpio(gpio); +} + static int pl061_direction_input(struct gpio_chip *gc, unsigned offset) { struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc); @@ -287,6 +294,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) spin_lock_init(&chip->lock); chip->gc.request = pl061_gpio_request; + chip->gc.free = pl061_gpio_free; chip->gc.direction_input = pl061_direction_input; chip->gc.direction_output = pl061_direction_output; chip->gc.get = pl061_get_value; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH RESEND] gpio: samsung: Add terminating entry for exynos_pinctrl_ids
The of_device_id table is supposed to be zero-terminated. Signed-off-by: Axel Lin Acked-by: Grant Likely --- This patch was sent on https://lkml.org/lkml/2012/12/9/135 Re-generate the patch against linux-next and resend. drivers/gpio/gpio-samsung.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index 99e0fa4..b22ca79 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -3030,6 +3030,7 @@ static __init int samsung_gpiolib_init(void) { .compatible = "samsung,exynos4x12-pinctrl", }, { .compatible = "samsung,exynos5250-pinctrl", }, { .compatible = "samsung,exynos5440-pinctrl", }, + { } }; for_each_matching_node(pctrl_np, exynos_pinctrl_ids) if (pctrl_np && of_device_is_available(pctrl_np)) -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] gpio: em: Fix checking return value of irq_alloc_descs
irq_alloc_descs() returns negative error code on failure. Signed-off-by: Axel Lin --- drivers/gpio/gpio-em.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index ae37181..ec48ed5 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c @@ -247,9 +247,9 @@ static int __devinit em_gio_irq_domain_init(struct em_gio_priv *p) p->irq_base = irq_alloc_descs(pdata->irq_base, 0, pdata->number_of_pins, numa_node_id()); - if (IS_ERR_VALUE(p->irq_base)) { + if (p->irq_base < 0) { dev_err(&pdev->dev, "cannot get irq_desc\n"); - return -ENXIO; + return p->irq_base; } pr_debug("gio: hw base = %d, nr = %d, sw base = %d\n", pdata->gpio_base, pdata->number_of_pins, p->irq_base); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] gpio: mc9s08dz60: Fix build error if I2C=m
Make GPIO_MC9S08DZ60 depend on I2C=y, this fixes below build error: LD init/built-in.o drivers/built-in.o: In function `mc9s08dz60_get_value': clk-fixed-factor.c:(.text+0x7214): undefined reference to `i2c_smbus_read_byte_data' drivers/built-in.o: In function `mc9s08dz60_set': clk-fixed-factor.c:(.text+0x727c): undefined reference to `i2c_smbus_read_byte_data' clk-fixed-factor.c:(.text+0x72bc): undefined reference to `i2c_smbus_write_byte_data' drivers/built-in.o: In function `mc9s08dz60_i2c_driver_init': clk-fixed-factor.c:(.init.text+0x290): undefined reference to `i2c_register_driver' drivers/built-in.o: In function `mc9s08dz60_i2c_driver_exit': clk-fixed-factor.c:(.exit.text+0x2c): undefined reference to `i2c_del_driver' make: *** [vmlinux] Error 1 Signed-off-by: Axel Lin --- drivers/gpio/Kconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index b16c8a7..ba7926f5 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -294,7 +294,7 @@ config GPIO_MAX732X_IRQ config GPIO_MC9S08DZ60 bool "MX35 3DS BOARD MC9S08DZ60 GPIO functions" - depends on I2C && MACH_MX35_3DS + depends on I2C=y && MACH_MX35_3DS help Select this to enable the MC9S08DZ60 GPIO driver -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] gpio: mc9s08dz60: Use devm_kzalloc API
Signed-off-by: Axel Lin --- drivers/gpio/gpio-mc9s08dz60.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/gpio/gpio-mc9s08dz60.c b/drivers/gpio/gpio-mc9s08dz60.c index 2738cc4..0ab7000 100644 --- a/drivers/gpio/gpio-mc9s08dz60.c +++ b/drivers/gpio/gpio-mc9s08dz60.c @@ -91,10 +91,9 @@ static int mc9s08dz60_direction_output(struct gpio_chip *gc, static int mc9s08dz60_probe(struct i2c_client *client, const struct i2c_device_id *id) { - int ret = 0; struct mc9s08dz60 *mc9s; - mc9s = kzalloc(sizeof(*mc9s), GFP_KERNEL); + mc9s = devm_kzalloc(&client->dev, sizeof(*mc9s), GFP_KERNEL); if (!mc9s) return -ENOMEM; @@ -110,30 +109,16 @@ static int mc9s08dz60_probe(struct i2c_client *client, mc9s->client = client; i2c_set_clientdata(client, mc9s); - ret = gpiochip_add(&mc9s->chip); - if (ret) - goto error; - - return 0; - - error: - kfree(mc9s); - return ret; + return gpiochip_add(&mc9s->chip); } static int mc9s08dz60_remove(struct i2c_client *client) { struct mc9s08dz60 *mc9s; - int ret; mc9s = i2c_get_clientdata(client); - ret = gpiochip_remove(&mc9s->chip); - if (!ret) - kfree(mc9s); - - return ret; - + return gpiochip_remove(&mc9s->chip); } static const struct i2c_device_id mc9s08dz60_id[] = { -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
drivers/gpio/gpio-em.c build error if CONFIG_GPIO_EM=m
Hi Magnus, I got below build error if CONFIG_GPIO_EM=m MODPOST 33 modules ERROR: "set_irq_flags" [drivers/gpio/gpio-em.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] gpio: Remove broken mark for da9052 gpio driver
The fix for MFD part is merged so remove the broken mark for da9052 gpio driver. Signed-off-by: Axel Lin --- drivers/gpio/Kconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index ba7926f5..95778f1 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -82,7 +82,7 @@ config GPIO_GENERIC config GPIO_DA9052 tristate "Dialog DA9052 GPIO" - depends on PMIC_DA9052 && BROKEN + depends on PMIC_DA9052 help Say yes here to enable the GPIO driver for the DA9052 chip. -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] video: mbxfb: Include linux/io.h instead of asm/io.h
This fixes below build error: CC [M] drivers/video/mbx/mbxfb.o drivers/video/mbx/mbxfb.c: In function 'mbxfb_probe': drivers/video/mbx/mbxfb.c:942:2: error: implicit declaration of function 'devm_ioremap_nocache' [-Werror=implicit-function-declaration] drivers/video/mbx/mbxfb.c:942:22: warning: assignment makes pointer from integer without a cast [enabled by default] drivers/video/mbx/mbxfb.c:952:21: warning: assignment makes pointer from integer without a cast [enabled by default] cc1: some warnings being treated as errors Signed-off-by: Axel Lin --- drivers/video/mbx/mbxfb.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c index 9229acf..6563e50 100644 --- a/drivers/video/mbx/mbxfb.c +++ b/drivers/video/mbx/mbxfb.c @@ -26,8 +26,7 @@ #include #include #include - -#include +#include #include -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] gpio: rdc321x: Prevent removal of modules exporting active GPIOs
This driver can be built as a module, set the missing owner field of struct gpio_chip to prevent removal of modules exporting active GPIOs. Signed-off-by: Axel Lin --- drivers/gpio/gpio-rdc321x.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-rdc321x.c b/drivers/gpio/gpio-rdc321x.c index e97016a..b62d443 100644 --- a/drivers/gpio/gpio-rdc321x.c +++ b/drivers/gpio/gpio-rdc321x.c @@ -170,6 +170,7 @@ static int __devinit rdc321x_gpio_probe(struct platform_device *pdev) rdc321x_gpio_dev->reg2_data_base = r->start + 0x4; rdc321x_gpio_dev->chip.label = "rdc321x-gpio"; + rdc321x_gpio_dev->chip.owner = THIS_MODULE; rdc321x_gpio_dev->chip.direction_input = rdc_gpio_direction_input; rdc321x_gpio_dev->chip.direction_output = rdc_gpio_config; rdc321x_gpio_dev->chip.get = rdc_gpio_get_value; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] gpio: da9052: Convert to use devm_kzalloc API
Signed-off-by: Axel Lin --- drivers/gpio/gpio-da9052.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/gpio/gpio-da9052.c b/drivers/gpio/gpio-da9052.c index 56dd047..24b8c29 100644 --- a/drivers/gpio/gpio-da9052.c +++ b/drivers/gpio/gpio-da9052.c @@ -207,7 +207,7 @@ static int __devinit da9052_gpio_probe(struct platform_device *pdev) struct da9052_pdata *pdata; int ret; - gpio = kzalloc(sizeof(*gpio), GFP_KERNEL); + gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); if (gpio == NULL) return -ENOMEM; @@ -221,28 +221,19 @@ static int __devinit da9052_gpio_probe(struct platform_device *pdev) ret = gpiochip_add(&gpio->gp); if (ret < 0) { dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); - goto err_mem; + return ret; } platform_set_drvdata(pdev, gpio); return 0; - -err_mem: - kfree(gpio); - return ret; } static int __devexit da9052_gpio_remove(struct platform_device *pdev) { struct da9052_gpio *gpio = platform_get_drvdata(pdev); - int ret; - - ret = gpiochip_remove(&gpio->gp); - if (ret == 0) - kfree(gpio); - return ret; + return gpiochip_remove(&gpio->gp); } static struct platform_driver da9052_gpio_driver = { -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] gpio: tps65912: Convert to use devm_kzalloc API
Signed-off-by: Axel Lin --- drivers/gpio/gpio-tps65912.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/gpio/gpio-tps65912.c b/drivers/gpio/gpio-tps65912.c index 79e66c0..99106d1 100644 --- a/drivers/gpio/gpio-tps65912.c +++ b/drivers/gpio/gpio-tps65912.c @@ -70,7 +70,6 @@ static int tps65912_gpio_input(struct gpio_chip *gc, unsigned offset) return tps65912_clear_bits(tps65912, TPS65912_GPIO1 + offset, GPIO_CFG_MASK); - } static struct gpio_chip template_chip = { @@ -92,7 +91,8 @@ static int __devinit tps65912_gpio_probe(struct platform_device *pdev) struct tps65912_gpio_data *tps65912_gpio; int ret; - tps65912_gpio = kzalloc(sizeof(*tps65912_gpio), GFP_KERNEL); + tps65912_gpio = devm_kzalloc(&pdev->dev, sizeof(*tps65912_gpio), +GFP_KERNEL); if (tps65912_gpio == NULL) return -ENOMEM; @@ -105,28 +105,19 @@ static int __devinit tps65912_gpio_probe(struct platform_device *pdev) ret = gpiochip_add(&tps65912_gpio->gpio_chip); if (ret < 0) { dev_err(&pdev->dev, "Failed to register gpiochip, %d\n", ret); - goto err; + return ret; } platform_set_drvdata(pdev, tps65912_gpio); return ret; - -err: - kfree(tps65912_gpio); - return ret; } static int __devexit tps65912_gpio_remove(struct platform_device *pdev) { struct tps65912_gpio_data *tps65912_gpio = platform_get_drvdata(pdev); - int ret; - - ret = gpiochip_remove(&tps65912_gpio->gpio_chip); - if (ret == 0) - kfree(tps65912_gpio); - return ret; + return gpiochip_remove(&tps65912_gpio->gpio_chip); } static struct platform_driver tps65912_gpio_driver = { -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] gpio: Use DEFINE_PCI_DEVICE_TABLE macro
Signed-off-by: Axel Lin --- drivers/gpio/gpio-bt8xx.c |2 +- drivers/gpio/gpio-sodaville.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-bt8xx.c b/drivers/gpio/gpio-bt8xx.c index 92d555d..7d9d7cb 100644 --- a/drivers/gpio/gpio-bt8xx.c +++ b/drivers/gpio/gpio-bt8xx.c @@ -310,7 +310,7 @@ static int bt8xxgpio_resume(struct pci_dev *pdev) #define bt8xxgpio_resume NULL #endif /* CONFIG_PM */ -static struct pci_device_id bt8xxgpio_pci_tbl[] = { +static DEFINE_PCI_DEVICE_TABLE(bt8xxgpio_pci_tbl) = { { PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848) }, { PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT849) }, { PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT878) }, diff --git a/drivers/gpio/gpio-sodaville.c b/drivers/gpio/gpio-sodaville.c index 9d9891f..e25f731 100644 --- a/drivers/gpio/gpio-sodaville.c +++ b/drivers/gpio/gpio-sodaville.c @@ -270,7 +270,7 @@ static void sdv_gpio_remove(struct pci_dev *pdev) kfree(sd); } -static struct pci_device_id sdv_gpio_pci_ids[] __devinitdata = { +static DEFINE_PCI_DEVICE_TABLE(sdv_gpio_pci_ids) = { { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_SDV_GPIO) }, { 0, }, }; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] gpio: adp5588: Use module_i2c_driver
Signed-off-by: Axel Lin --- drivers/gpio/gpio-adp5588.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c index ae5d7f1..eeedad4 100644 --- a/drivers/gpio/gpio-adp5588.c +++ b/drivers/gpio/gpio-adp5588.c @@ -483,19 +483,7 @@ static struct i2c_driver adp5588_gpio_driver = { .id_table = adp5588_gpio_id, }; -static int __init adp5588_gpio_init(void) -{ - return i2c_add_driver(&adp5588_gpio_driver); -} - -module_init(adp5588_gpio_init); - -static void __exit adp5588_gpio_exit(void) -{ - i2c_del_driver(&adp5588_gpio_driver); -} - -module_exit(adp5588_gpio_exit); +module_i2c_driver(adp5588_gpio_driver); MODULE_AUTHOR("Michael Hennerich "); MODULE_DESCRIPTION("GPIO ADP5588 Driver"); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] gpio: wm831x: Convert to use devm_kzalloc API
Signed-off-by: Axel Lin --- drivers/gpio/gpio-wm831x.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c index e56a216..b6eda35 100644 --- a/drivers/gpio/gpio-wm831x.c +++ b/drivers/gpio/gpio-wm831x.c @@ -250,7 +250,8 @@ static int __devinit wm831x_gpio_probe(struct platform_device *pdev) struct wm831x_gpio *wm831x_gpio; int ret; - wm831x_gpio = kzalloc(sizeof(*wm831x_gpio), GFP_KERNEL); + wm831x_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm831x_gpio), + GFP_KERNEL); if (wm831x_gpio == NULL) return -ENOMEM; @@ -265,30 +266,20 @@ static int __devinit wm831x_gpio_probe(struct platform_device *pdev) ret = gpiochip_add(&wm831x_gpio->gpio_chip); if (ret < 0) { - dev_err(&pdev->dev, "Could not register gpiochip, %d\n", - ret); - goto err; + dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); + return ret; } platform_set_drvdata(pdev, wm831x_gpio); return ret; - -err: - kfree(wm831x_gpio); - return ret; } static int __devexit wm831x_gpio_remove(struct platform_device *pdev) { struct wm831x_gpio *wm831x_gpio = platform_get_drvdata(pdev); - int ret; - - ret = gpiochip_remove(&wm831x_gpio->gpio_chip); - if (ret == 0) - kfree(wm831x_gpio); - return ret; + return gpiochip_remove(&wm831x_gpio->gpio_chip); } static struct platform_driver wm831x_gpio_driver = { -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] gpio: wm8350: Convert to use devm_kzalloc API
Signed-off-by: Axel Lin --- drivers/gpio/gpio-wm8350.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/gpio/gpio-wm8350.c b/drivers/gpio/gpio-wm8350.c index a06af51..fb42938 100644 --- a/drivers/gpio/gpio-wm8350.c +++ b/drivers/gpio/gpio-wm8350.c @@ -116,7 +116,8 @@ static int __devinit wm8350_gpio_probe(struct platform_device *pdev) struct wm8350_gpio_data *wm8350_gpio; int ret; - wm8350_gpio = kzalloc(sizeof(*wm8350_gpio), GFP_KERNEL); + wm8350_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm8350_gpio), + GFP_KERNEL); if (wm8350_gpio == NULL) return -ENOMEM; @@ -131,30 +132,20 @@ static int __devinit wm8350_gpio_probe(struct platform_device *pdev) ret = gpiochip_add(&wm8350_gpio->gpio_chip); if (ret < 0) { - dev_err(&pdev->dev, "Could not register gpiochip, %d\n", - ret); - goto err; + dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); + return ret; } platform_set_drvdata(pdev, wm8350_gpio); return ret; - -err: - kfree(wm8350_gpio); - return ret; } static int __devexit wm8350_gpio_remove(struct platform_device *pdev) { struct wm8350_gpio_data *wm8350_gpio = platform_get_drvdata(pdev); - int ret; - - ret = gpiochip_remove(&wm8350_gpio->gpio_chip); - if (ret == 0) - kfree(wm8350_gpio); - return ret; + return gpiochip_remove(&wm8350_gpio->gpio_chip); } static struct platform_driver wm8350_gpio_driver = { -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ARM: ux500: Fix build error due to missing include of asm/pmu.h in cpu-db8500.c
Include asm/pmu.h to fix below build error: CC arch/arm/mach-ux500/cpu-db8500.o arch/arm/mach-ux500/cpu-db8500.c:118:8: error: variable 'db8500_pmu_platdata' has initializer but incomplete type arch/arm/mach-ux500/cpu-db8500.c:119:2: error: unknown field 'handle_irq' specified in initializer arch/arm/mach-ux500/cpu-db8500.c:119:2: warning: excess elements in struct initializer [enabled by default] arch/arm/mach-ux500/cpu-db8500.c:119:2: warning: (near initialization for 'db8500_pmu_platdata') [enabled by default] make[1]: *** [arch/arm/mach-ux500/cpu-db8500.o] Error 1 make: *** [arch/arm/mach-ux500] Error 2 Signed-off-by: Axel Lin --- arch/arm/mach-ux500/cpu-db8500.c |1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 8169f2c..3ce7d94 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: ux500: Fix build error due to missing include of asm/pmu.h in cpu-db8500.c
2012/9/3 Linus Walleij : > On Sun, Sep 2, 2012 at 2:25 PM, Axel Lin wrote: > >> Include asm/pmu.h to fix below build error: >> >> CC arch/arm/mach-ux500/cpu-db8500.o >> arch/arm/mach-ux500/cpu-db8500.c:118:8: error: variable >> 'db8500_pmu_platdata' has initializer but incomplete type >> arch/arm/mach-ux500/cpu-db8500.c:119:2: error: unknown field 'handle_irq' >> specified in initializer >> arch/arm/mach-ux500/cpu-db8500.c:119:2: warning: excess elements in struct >> initializer [enabled by default] >> arch/arm/mach-ux500/cpu-db8500.c:119:2: warning: (near initialization for >> 'db8500_pmu_platdata') [enabled by default] >> make[1]: *** [arch/arm/mach-ux500/cpu-db8500.o] Error 1 >> make: *** [arch/arm/mach-ux500] Error 2 >> >> Signed-off-by: Axel Lin > > That's on linux-next not on v3.6-rcN right? Yes, This patch is against linux-next tree. > > I've applied it to my ux500 branch and will carry it unless Will Deacon > express an interest in it, PMU is his territory... Thanks, 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ARM: ep93xx: Fix build error due to 'SZ_32M' undeclared
Include linux/sizes.h to fix below build errors: CC arch/arm/mach-ep93xx/adssphere.o arch/arm/mach-ep93xx/adssphere.c: In function 'adssphere_init_machine': arch/arm/mach-ep93xx/adssphere.c:32:49: error: 'SZ_32M' undeclared (first use in this function) arch/arm/mach-ep93xx/adssphere.c:32:49: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [arch/arm/mach-ep93xx/adssphere.o] Error 1 make: *** [arch/arm/mach-ep93xx] Error 2 CC arch/arm/mach-ep93xx/gesbc9312.o arch/arm/mach-ep93xx/gesbc9312.c: In function 'gesbc9312_init_machine': arch/arm/mach-ep93xx/gesbc9312.c:32:49: error: 'SZ_8M' undeclared (first use in this function) arch/arm/mach-ep93xx/gesbc9312.c:32:49: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [arch/arm/mach-ep93xx/gesbc9312.o] Error 1 make: *** [arch/arm/mach-ep93xx] Error 2 Signed-off-by: Axel Lin --- This patch is against linux-next tree. Axel arch/arm/mach-ep93xx/adssphere.c |1 + arch/arm/mach-ep93xx/gesbc9312.c |1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c index a472777..41383bf 100644 --- a/arch/arm/mach-ep93xx/adssphere.c +++ b/arch/arm/mach-ep93xx/adssphere.c @@ -13,6 +13,7 @@ #include #include #include +#include #include diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c index 437c341..7fd705b 100644 --- a/arch/arm/mach-ep93xx/gesbc9312.c +++ b/arch/arm/mach-ep93xx/gesbc9312.c @@ -13,6 +13,7 @@ #include #include #include +#include #include -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] gpio: em: Use irq_data_get_irq_chip_data() at appropriate places
Then we can remove irq_to_priv() function. Signed-off-by: Axel Lin --- drivers/gpio/gpio-em.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index ec48ed5..efb4c2d 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c @@ -85,22 +85,16 @@ static inline void em_gio_write(struct em_gio_priv *p, int offs, iowrite32(value, p->base1 + (offs - GIO_IDT0)); } -static inline struct em_gio_priv *irq_to_priv(struct irq_data *d) -{ - struct irq_chip *chip = irq_data_get_irq_chip(d); - return container_of(chip, struct em_gio_priv, irq_chip); -} - static void em_gio_irq_disable(struct irq_data *d) { - struct em_gio_priv *p = irq_to_priv(d); + struct em_gio_priv *p = irq_data_get_irq_chip_data(d); em_gio_write(p, GIO_IDS, BIT(irqd_to_hwirq(d))); } static void em_gio_irq_enable(struct irq_data *d) { - struct em_gio_priv *p = irq_to_priv(d); + struct em_gio_priv *p = irq_data_get_irq_chip_data(d); em_gio_write(p, GIO_IEN, BIT(irqd_to_hwirq(d))); } @@ -118,7 +112,7 @@ static unsigned char em_gio_sense_table[IRQ_TYPE_SENSE_MASK + 1] = { static int em_gio_irq_set_type(struct irq_data *d, unsigned int type) { unsigned char value = em_gio_sense_table[type & IRQ_TYPE_SENSE_MASK]; - struct em_gio_priv *p = irq_to_priv(d); + struct em_gio_priv *p = irq_data_get_irq_chip_data(d); unsigned int reg, offset, shift; unsigned long flags; unsigned long tmp; -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] gpio: sx150x: Use irq_data_get_irq_chip_data() at appropriate places
Signed-off-by: Axel Lin --- drivers/gpio/gpio-sx150x.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c index a4f7353..eb3e215 100644 --- a/drivers/gpio/gpio-sx150x.c +++ b/drivers/gpio/gpio-sx150x.c @@ -311,11 +311,9 @@ static int sx150x_gpio_to_irq(struct gpio_chip *gc, unsigned offset) static void sx150x_irq_mask(struct irq_data *d) { - struct irq_chip *ic = irq_data_get_irq_chip(d); - struct sx150x_chip *chip; + struct sx150x_chip *chip = irq_data_get_irq_chip_data(d); unsigned n; - chip = container_of(ic, struct sx150x_chip, irq_chip); n = d->irq - chip->irq_base; chip->irq_masked |= (1 << n); chip->irq_update = n; @@ -323,27 +321,22 @@ static void sx150x_irq_mask(struct irq_data *d) static void sx150x_irq_unmask(struct irq_data *d) { - struct irq_chip *ic = irq_data_get_irq_chip(d); - struct sx150x_chip *chip; + struct sx150x_chip *chip = irq_data_get_irq_chip_data(d); unsigned n; - chip = container_of(ic, struct sx150x_chip, irq_chip); n = d->irq - chip->irq_base; - chip->irq_masked &= ~(1 << n); chip->irq_update = n; } static int sx150x_irq_set_type(struct irq_data *d, unsigned int flow_type) { - struct irq_chip *ic = irq_data_get_irq_chip(d); - struct sx150x_chip *chip; + struct sx150x_chip *chip = irq_data_get_irq_chip_data(d); unsigned n, val = 0; if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) return -EINVAL; - chip = container_of(ic, struct sx150x_chip, irq_chip); n = d->irq - chip->irq_base; if (flow_type & IRQ_TYPE_EDGE_RISING) @@ -391,22 +384,16 @@ static irqreturn_t sx150x_irq_thread_fn(int irq, void *dev_id) static void sx150x_irq_bus_lock(struct irq_data *d) { - struct irq_chip *ic = irq_data_get_irq_chip(d); - struct sx150x_chip *chip; - - chip = container_of(ic, struct sx150x_chip, irq_chip); + struct sx150x_chip *chip = irq_data_get_irq_chip_data(d); mutex_lock(&chip->lock); } static void sx150x_irq_bus_sync_unlock(struct irq_data *d) { - struct irq_chip *ic = irq_data_get_irq_chip(d); - struct sx150x_chip *chip; + struct sx150x_chip *chip = irq_data_get_irq_chip_data(d); unsigned n; - chip = container_of(ic, struct sx150x_chip, irq_chip); - if (chip->irq_update == NO_UPDATE_PENDING) goto out; @@ -551,6 +538,7 @@ static int sx150x_install_irq_chip(struct sx150x_chip *chip, for (n = 0; n < chip->dev_cfg->ngpios; ++n) { irq = irq_base + n; + irq_set_chip_data(irq, chip); irq_set_chip_and_handler(irq, &chip->irq_chip, handle_edge_irq); irq_set_nested_thread(irq, 1); #ifdef CONFIG_ARM -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] HID: hid-lcpower: Use HID_UP_LOGIVENDOR instead of hard coded 0x0ffbc0000
Signed-off-by: Axel Lin --- drivers/hid/hid-lcpower.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-lcpower.c b/drivers/hid/hid-lcpower.c index c4fe9bd0..22bc14a 100644 --- a/drivers/hid/hid-lcpower.c +++ b/drivers/hid/hid-lcpower.c @@ -24,7 +24,7 @@ static int ts_input_mapping(struct hid_device *hdev, struct hid_input *hi, struct hid_field *field, struct hid_usage *usage, unsigned long **bit, int *max) { - if ((usage->hid & HID_USAGE_PAGE) != 0x0ffbc) + if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) return 0; switch (usage->hid & HID_USAGE) { -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] HID: picolcd_fb: Use flush_delayed_work instead of flush_delayed_work_sync
Seems this is a left over of commit 4382973 "workqueue: deprecate flush[_delayed]_work_sync()" This fixes below build warning: CC [M] drivers/hid/hid-picolcd_fb.o drivers/hid/hid-picolcd_fb.c: In function 'picolcd_exit_framebuffer': drivers/hid/hid-picolcd_fb.c:611:2: warning: 'flush_delayed_work_sync' is deprecated (declared at include/linux/workqueue.h:454) [-Wdeprecated-declarations] Signed-off-by: Axel Lin Cc: Tejun Heo --- drivers/hid/hid-picolcd_fb.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-picolcd_fb.c b/drivers/hid/hid-picolcd_fb.c index 0008a51..eb00357 100644 --- a/drivers/hid/hid-picolcd_fb.c +++ b/drivers/hid/hid-picolcd_fb.c @@ -608,7 +608,7 @@ void picolcd_exit_framebuffer(struct picolcd_data *data) /* make sure there is no running update - thus that fbdata->picolcd * once obtained under lock is guaranteed not to get free() under * the feet of the deferred work */ - flush_delayed_work_sync(&info->deferred_work); + flush_delayed_work(&info->deferred_work); data->fb_info = NULL; unregister_framebuffer(info); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] HID: hid-sensor-hub: Clear HID_CLAIMED_INPUT bit earlier
Clear HID_CLAIMED_INPUT bit of hdev->claimed, this prevents calling hidinput_disconnect() in hid_disconnect(), which is called by hid_hw_stop(). We need to clear HID_CLAIMED_INPUT bit earlier rather than in sensor_hub_remove() because we also call hid_hw_stop() in sensor_hub_probe error handling. Also adds comments for why we set hdev->claimed = HID_CLAIMED_INPUT. Signed-off-by: Axel Lin --- Hi srinivas, I don't have this hardware, I'd appreciate if you can test these patches. Axel drivers/hid/hid-sensor-hub.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index 4ac759c..50bc8c7 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c @@ -539,8 +539,11 @@ static int sensor_hub_probe(struct hid_device *hdev, } INIT_LIST_HEAD(&hdev->inputs); + /* We don't use hidinput but hid_hw_start() fails if nothing is +* claimed. So spoof claimed input. */ hdev->claimed = HID_CLAIMED_INPUT; ret = hid_hw_start(hdev, 0); + hdev->claimed &= ~HID_CLAIMED_INPUT; if (ret) { hid_err(hdev, "hw start failed\n"); goto err_free; @@ -627,7 +630,6 @@ static void sensor_hub_remove(struct hid_device *hdev) int i; hid_dbg(hdev, " hardware removed\n"); - hdev->claimed &= ~HID_CLAIMED_INPUT; hid_hw_stop(hdev); hid_hw_close(hdev); spin_lock_irqsave(&data->lock, flags); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] HID: hid-sensor-hub: Fix sensor_hub_probe error handling
Fix below issues in sensor_hub_probe error handling: 1. In the case of goto err_close, hid_hw_stop(hdev) is called twice. Fix it. 2. If fails to allocate MFD device name, we also need to free all successfully allocated names in previous iterations. Signed-off-by: Axel Lin --- drivers/hid/hid-sensor-hub.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index 50bc8c7..8bd7620 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c @@ -584,7 +584,7 @@ static int sensor_hub_probe(struct hid_device *hdev, hid_err(hdev, "Failed MFD device name\n"); ret = -ENOMEM; - goto err_free_cells; + goto err_free_names; } sd->hid_sensor_hub_client_devs[ sd->hid_sensor_client_cnt].name = name; @@ -608,10 +608,8 @@ static int sensor_hub_probe(struct hid_device *hdev, err_free_names: for (i = 0; i < sd->hid_sensor_client_cnt ; ++i) kfree(sd->hid_sensor_hub_client_devs[i].name); -err_free_cells: kfree(sd->hid_sensor_hub_client_devs); err_close: - hid_hw_stop(hdev); hid_hw_close(hdev); err_stop_hw: hid_hw_stop(hdev); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] HID: hid-sensor-hub: Clear HID_CLAIMED_INPUT bit earlier
2012/9/13 Axel Lin : > Clear HID_CLAIMED_INPUT bit of hdev->claimed, this prevents calling > hidinput_disconnect() in hid_disconnect(), which is called by hid_hw_stop(). > > We need to clear HID_CLAIMED_INPUT bit earlier rather than in > sensor_hub_remove() because we also call hid_hw_stop() in sensor_hub_probe > error handling. > > Also adds comments for why we set hdev->claimed = HID_CLAIMED_INPUT. > > Signed-off-by: Axel Lin > --- > Hi srinivas, > I don't have this hardware, I'd appreciate if you can test these patches. > Axel > > drivers/hid/hid-sensor-hub.c |4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c > index 4ac759c..50bc8c7 100644 > --- a/drivers/hid/hid-sensor-hub.c > +++ b/drivers/hid/hid-sensor-hub.c > @@ -539,8 +539,11 @@ static int sensor_hub_probe(struct hid_device *hdev, > } > INIT_LIST_HEAD(&hdev->inputs); > > + /* We don't use hidinput but hid_hw_start() fails if nothing is > +* claimed. So spoof claimed input. */ > hdev->claimed = HID_CLAIMED_INPUT; > ret = hid_hw_start(hdev, 0); I check the implementation of hid_hw_start again, it looks hid_hw_start allows connect_mask to be 0. So we don't need setting "hdev->claimed = HID_CLAIMED_INPUT;" here. Comments? 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] HID: hid-sensor-hub: Clear HID_CLAIMED_INPUT bit earlier
2012/9/14 Pandruvada, Srinivas : > Hi Axel, > > We don't need this anymore as when connect_mask is 0, the hid_connect will > not be called. > So we don't need hdev->claimed = HID_CLAIMED_INPUT anymore. > Okay. I'm going to resend the patch for this serial. 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] extcon: Fix kerneldoc for extcon_set_cable_state and extcon_set_cable_state_
Signed-off-by: Axel Lin --- drivers/extcon/extcon-class.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c index 946a318..337bbb4 100644 --- a/drivers/extcon/extcon-class.c +++ b/drivers/extcon/extcon-class.c @@ -362,7 +362,7 @@ int extcon_get_cable_state(struct extcon_dev *edev, const char *cable_name) EXPORT_SYMBOL_GPL(extcon_get_cable_state); /** - * extcon_get_cable_state_() - Set the status of a specific cable. + * extcon_set_cable_state_() - Set the status of a specific cable. * @edev: the extcon device that has the cable. * @index: cable index that can be retrieved by extcon_find_cable_index(). * @cable_state: the new cable status. The default semantics is @@ -382,7 +382,7 @@ int extcon_set_cable_state_(struct extcon_dev *edev, EXPORT_SYMBOL_GPL(extcon_set_cable_state_); /** - * extcon_get_cable_state() - Set the status of a specific cable. + * extcon_set_cable_state() - Set the status of a specific cable. * @edev: the extcon device that has the cable. * @cable_name:cable name. * @cable_state: the new cable status. The default semantics is -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] extcon: max77693: Use max77693_update_reg for rmw operations
This simplifies the code. Signed-off-by: Axel Lin --- drivers/extcon/extcon-max77693.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c index e21387e..e0ed622 100644 --- a/drivers/extcon/extcon-max77693.c +++ b/drivers/extcon/extcon-max77693.c @@ -239,25 +239,19 @@ const char *max77693_extcon_cable[] = { static int max77693_muic_set_debounce_time(struct max77693_muic_info *info, enum max77693_muic_adc_debounce_time time) { - int ret = 0; - u8 ctrl3; + int ret; switch (time) { case ADC_DEBOUNCE_TIME_5MS: case ADC_DEBOUNCE_TIME_10MS: case ADC_DEBOUNCE_TIME_25MS: case ADC_DEBOUNCE_TIME_38_62MS: - ret = max77693_read_reg(info->max77693->regmap_muic, - MAX77693_MUIC_REG_CTRL3, &ctrl3); - ctrl3 &= ~CONTROL3_ADCDBSET_MASK; - ctrl3 |= (time << CONTROL3_ADCDBSET_SHIFT); - - ret = max77693_write_reg(info->max77693->regmap_muic, - MAX77693_MUIC_REG_CTRL3, ctrl3); - if (ret) { + ret = max77693_update_reg(info->max77693->regmap_muic, + MAX77693_MUIC_REG_CTRL3, + time << CONTROL3_ADCDBSET_SHIFT, + CONTROL3_ADCDBSET_MASK); + if (ret) dev_err(info->dev, "failed to set ADC debounce time\n"); - ret = -EINVAL; - } break; default: dev_err(info->dev, "invalid ADC debounce time\n"); -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] extcon: max77693: Fix max77693_muic_probe error handling
Fix below issues: 1. If request_threaded_irq() fails, current code does not free all requested irqs. 2. Add missing extcon_dev_unregister() in error path if failed to read revision number. Signed-off-by: Axel Lin --- drivers/extcon/extcon-max77693.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c index e0ed622..9928c63 100644 --- a/drivers/extcon/extcon-max77693.c +++ b/drivers/extcon/extcon-max77693.c @@ -696,12 +696,8 @@ static int __devinit max77693_muic_probe(struct platform_device *pdev) IRQF_ONESHOT, muic_irq->name, info); if (ret) { dev_err(&pdev->dev, - "failed: irq request (IRQ: %d," - " error :%d)\n", + "failed: irq request (IRQ: %d, error :%d)\n", muic_irq->irq, ret); - - for (i = i - 1; i >= 0; i--) - free_irq(muic_irq->virq, info); goto err_irq; } } @@ -726,7 +722,7 @@ static int __devinit max77693_muic_probe(struct platform_device *pdev) MAX77693_MUIC_REG_ID, &id); if (ret < 0) { dev_err(&pdev->dev, "failed to read revision number\n"); - goto err_extcon; + goto err_read_reg; } dev_info(info->dev, "device ID : 0x%x\n", id); @@ -738,9 +734,13 @@ static int __devinit max77693_muic_probe(struct platform_device *pdev) return ret; +err_read_reg: + extcon_dev_unregister(info->edev); err_extcon: kfree(info->edev); err_irq: + while (--i >= 0) + free_irq(muic_irqs[i].virq, info); err_regmap: kfree(info); err_kfree: -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
mfd: rc5t583-irq.c build warning: array subscript is above array bounds
hi Laxman, I got below compile warning when build this driver. CC drivers/mfd/rc5t583-irq.o drivers/mfd/rc5t583-irq.c: In function 'rc5t583_irq_sync_unlock': drivers/mfd/rc5t583-irq.c:227: warning: array subscript is above array bounds drivers/mfd/rc5t583-irq.c: In function 'rc5t583_irq_init': drivers/mfd/rc5t583-irq.c:349: warning: array subscript is above array bounds 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] regulator: Fix trivial typo for TPS51632 Kconfig help text
Signed-off-by: Axel Lin --- drivers/regulator/Kconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 7b920c7..cbc685d 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -341,7 +341,7 @@ config REGULATOR_TPS51632 select REGMAP_I2C help This driver supports TPS51632 voltage regulator chip. - The TPS52632 is 3-2-1 Phase D-Cap+ Step Down Driverless Controller + The TPS51632 is 3-2-1 Phase D-Cap+ Step Down Driverless Controller with Serial VID control and DVFS. The voltage output can be configure through I2C interface or PWM interface. -- 1.7.9.5 -- 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
regulator: tps51632: Seems current code doesn't properly support dvfs_step_20mV case
Hi Laxman, While reading the tps51632 driver, I found there is a dvfs_step_20mV setting in platform data. But seems current code doesn't properly handle the case when dvfs_step_20mV is true. I guess if pdata->dvfs_step_20mV is true, we need: tps->desc.uV_step = TPS51632_VOLATGE_STEP_20mV; Fix TPS51632_VOLT_VSEL macro to support dvfs_step_20mV case. Also I'm wondering if either TPS51632_MAX_VSEL/TPS51632_MAX_VOLATGE or desc.n_voltages needs change for dvfs_step_20mV case. Oh, I don't have the datasheet, so my understanding might be wrong. 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/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/