Re: [PATCH] backlight: lm3630: remove ret = -EIO of lm3630_backlight_register()
2013년 02월 04일 09:14, Jingoo Han 쓴 글: There is no need to return -EIO, because backlight_device_register() already returns correct error values. Signed-off-by: Jingoo Han --- drivers/video/backlight/lm3630_bl.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/lm3630_bl.c b/drivers/video/backlight/lm3630_bl.c index a6d637b..76a62e9 100644 --- a/drivers/video/backlight/lm3630_bl.c +++ b/drivers/video/backlight/lm3630_bl.c @@ -320,7 +320,7 @@ static int lm3630_backlight_register(struct lm3630_chip_data *pchip, backlight_device_register(name, pchip->dev, pchip, &lm3630_bank_a_ops, &props); if (IS_ERR(pchip->bled1)) - return -EIO; + return PTR_ERR(pchip->bled1); break; case BLED_2: props.brightness = pdata->init_brt_led2; @@ -329,7 +329,7 @@ static int lm3630_backlight_register(struct lm3630_chip_data *pchip, backlight_device_register(name, pchip->dev, pchip, &lm3630_bank_b_ops, &props); if (IS_ERR(pchip->bled2)) - return -EIO; + return PTR_ERR(pchip->bled2); break; } return 0; Thank you. This patch looks good for us. Acked-by: Daniel Jeong -- 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: lp8755: Don't show unrelated messags in lp8755_probe error paths
2013년 01월 12일 15:58, Axel Lin 쓴 글: Signed-off-by: Axel Lin --- drivers/regulator/lp8755.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/regulator/lp8755.c b/drivers/regulator/lp8755.c index decb3ad..8c3f3f2 100644 --- a/drivers/regulator/lp8755.c +++ b/drivers/regulator/lp8755.c @@ -497,35 +497,36 @@ static int lp8755_probe(struct i2c_client *client, if (!pchip->pdata) return -ENOMEM; ret = lp8755_init_data(pchip); - if (ret < 0) - goto err_chip_init; + if (ret < 0) { + dev_err(&client->dev, "fail to initialize chip\n"); + return ret; + } } ret = lp8755_regulator_init(pchip); - if (ret < 0) + if (ret < 0) { + dev_err(&client->dev, "fail to initialize regulators\n"); goto err_regulator; + } pchip->irq = client->irq; ret = lp8755_int_config(pchip); - if (ret < 0) + if (ret < 0) { + dev_err(&client->dev, "fail to irq config\n"); goto err_irq; + } return ret; err_irq: - dev_err(&client->dev, "fail to irq config\n"); - for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++) regulator_unregister(pchip->rdev[icnt]); err_regulator: - dev_err(&client->dev, "fail to initialize regulators\n"); /* output disable */ for (icnt = 0; icnt < 0x06; icnt++) lp8755_write(pchip, icnt, 0x00); -err_chip_init: - dev_err(&client->dev, "fail to initialize chip\n"); return ret; } It is nice to us also and this patch was tested using a lp8755 board. Thank you 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] regulator: lp8755: Fix mask for pchip->mphase
2012년 12월 26일 11:12, Axel Lin 쓴 글: According to lp8755.h: enum lp8755_mphase_config { MPHASE_CONF0, MPHASE_CONF1, MPHASE_CONF2, MPHASE_CONF3, MPHASE_CONF4, MPHASE_CONF5, MPHASE_CONF6, MPHASE_CONF7, MPHASE_CONF8, MPHASE_CONF_MAX }; MPHASE_CONF_MAX is 9, the mask for pchip->mphase should be 0x17. Otherwise, we cannot differentiate MPHASE_CONF0 and MPHASE_CONF8. Signed-off-by: Axel Lin --- Hi Daniel, I don't have the datasheet, can you check if this patch is correct? BTW, I'm Axel, not Alex. Regards, Axel drivers/regulator/lp8755.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/lp8755.c b/drivers/regulator/lp8755.c index 06a82e2..6d5a11d 100644 --- a/drivers/regulator/lp8755.c +++ b/drivers/regulator/lp8755.c @@ -301,7 +301,7 @@ static int lp8755_init_data(struct lp8755_chip *pchip) ret = lp8755_read(pchip, 0x3D, ®val); if (ret < 0) goto out_i2c_error; - pchip->mphase = regval & 0x07; + pchip->mphase = regval & 0x17; /* set default data based on multi-phase config */ for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++) { Hi Axel. According to the new datasheet, it has 9 multi-phase mode from 0 to 8 and it takes 4bits in the register. the mask for pchip->mphase should be 0x0F. Thank you for your 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] regulator: lp8755: Fix lp8755_regulator_init unwind code
2012년 12월 25일 11:06, Axel Lin 쓴 글: This patch also includes below cleanups: Show correct regulator id in dev_err. Remove __devexit_p. Signed-off-by: Axel Lin --- drivers/regulator/lp8755.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/lp8755.c b/drivers/regulator/lp8755.c index dbc4d12..06a82e2 100644 --- a/drivers/regulator/lp8755.c +++ b/drivers/regulator/lp8755.c @@ -358,7 +358,9 @@ static int lp8755_regulator_init(struct lp8755_chip *pchip) regulator_register(&lp8755_regulators[buck_num], &rconfig); if (IS_ERR(pchip->rdev[buck_num])) { ret = PTR_ERR(pchip->rdev[buck_num]); - dev_err(pchip->dev, "regulator init failed: buck 0\n"); + pchip->rdev[buck_num] = NULL; + dev_err(pchip->dev, "regulator init failed: buck %d\n", + buck_num); goto err_buck; } } @@ -367,8 +369,7 @@ static int lp8755_regulator_init(struct lp8755_chip *pchip) err_buck: for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++) - if (pchip->rdev[icnt] != NULL) - regulator_unregister(pchip->rdev[icnt]); + regulator_unregister(pchip->rdev[icnt]); return ret; } @@ -557,7 +558,7 @@ static struct i2c_driver lp8755_i2c_driver = { .name = LP8755_NAME, }, .probe = lp8755_probe, - .remove = __devexit_p(lp8755_remove), + .remove = lp8755_remove, .id_table = lp8755_id, }; -- 1.7.9.5 Thank you Alex. I will check your patch and test it using my board. -- 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] backlight: lm3639_bl: Fix up world writable sysfs file
2012년 10월 29일 17:38, Axel Lin 쓴 글: We don't need the sysfs file to be world writable or group writable. This file is write-only, change it to S_IWUSR (0200). Signed-off-by: Axel Lin --- drivers/video/backlight/lm3639_bl.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c index 585949b..6f7a20e 100644 --- a/drivers/video/backlight/lm3639_bl.c +++ b/drivers/video/backlight/lm3639_bl.c @@ -214,7 +214,7 @@ out_input: } -static DEVICE_ATTR(bled_mode, 0666, NULL, lm3639_bled_mode_store); +static DEVICE_ATTR(bled_mode, S_IWUSR, NULL, lm3639_bled_mode_store); /* torch */ static void lm3639_torch_brightness_set(struct led_classdev *cdev, It's also nice to us. Thank you Alex. Acked-by: G.Shark Jeong -- 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] backlight: lm3639: Return proper error in lm3639_bled_mode_store error paths
2012년 10월 11일 14:11, Axel Lin 쓴 글: Signed-off-by: Axel Lin --- drivers/video/backlight/lm3639_bl.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c index c6915c6..585949b 100644 --- a/drivers/video/backlight/lm3639_bl.c +++ b/drivers/video/backlight/lm3639_bl.c @@ -206,11 +206,11 @@ static ssize_t lm3639_bled_mode_store(struct device *dev, out: dev_err(pchip->dev, "%s:i2c access fail to register\n", __func__); - return size; + return ret; out_input: dev_err(pchip->dev, "%s:input conversion fail\n", __func__); - return size; + return ret; } Thank you Alex for fixing code. Acked-by: G.Shark Jeong -- 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] leds: lm3642: Use regmap_update_bits() in lm3642_chip_init()
2012년 09월 22일 15:40, Axel Lin 쓴 글: Use regmap_update_bits() to replace regmap_read() + regmap_write(). With this patch, we only show the error message when regmap_update_bits() fails. Looks good..You're right. Thank you Alex. Signed-off-by: Axel Lin Acked-by: G.Shark Jeong --- drivers/leds/leds-lm3642.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/leds/leds-lm3642.c b/drivers/leds/leds-lm3642.c index 924853b..3285006 100644 --- a/drivers/leds/leds-lm3642.c +++ b/drivers/leds/leds-lm3642.c @@ -95,23 +95,14 @@ struct lm3642_chip_data { /* chip initialize */ static int __devinit lm3642_chip_init(struct lm3642_chip_data *chip) { - unsigned int reg_val; int ret; struct lm3642_platform_data *pdata = chip->pdata; /* set enable register */ - ret = regmap_read(chip->regmap, REG_ENABLE, ®_val); + ret = regmap_update_bits(chip->regmap, REG_ENABLE, EX_PIN_ENABLE_MASK, +pdata->tx_pin); if (ret < 0) - goto out; - - reg_val &= (~EX_PIN_ENABLE_MASK); - reg_val |= pdata->tx_pin; - ret = regmap_write(chip->regmap, REG_ENABLE, reg_val); - if (ret < 0) - goto out; - -out: - dev_err(chip->dev, "Failed to read REG_ENABLE Register\n"); + dev_err(chip->dev, "Failed to update REG_ENABLE Register\n"); 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/
Re: [PATCH 2/2] backlight: add new lm3639 backlight driver
LM3639 has not only pins for backlihgt but also pins for LEDs. So it uses functions in led_class and led_core file. When I see your config file, "randconig", you set CONFIG_NEW_LEDS=y but you didn't set CONFIG_LEDS_CLASS. We need to set CONFIG_NEW_LEDS and CONFIG_LEDS_CLASS both to compile it. To fix it, I added two reverse dependencies "select NEW_LEDS" and "select CONFIG_LEDS_CLASS". 2012년 09월 10일 14:28, Randy Dunlap 쓴 글: On 09/09/2012 08:16 PM, G.Shark Jeong wrote: From: "G.Shark Jeong" This driver is a general version for LM3639 backlgiht driver chip of TI. Put NEW_LEDS and LEDS_CLASS into Kconfig file to reduce additional configuration works in LEDs. www.ti.com eh? Signed-off-by: G.Shark Jeong Linus has asked patch committers to use Reported-by when appropriate. Reported-by: Randy Dunlap Acked-by: Randy Dunlap --- drivers/video/backlight/Kconfig |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 2ed68bd..e6c78cd 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -356,6 +356,8 @@ config BACKLIGHT_LM3639 tristate "Backlight Driver for LM3639" depends on BACKLIGHT_CLASS_DEVICE && I2C select REGMAP_I2C + select NEW_LEDS + select LEDS_CLASS help This supports TI LM3639 Backlight + 1.5A Flash LED Driver -- 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: mmotm 2012-09-06-16-46 uploaded (drivers/video/backlight/lm3639_bl)
Hi Randy. LM3630/9 have the pins for led so these depend on BACKLIGHT_CLASS_DEVICE and I2C. So we need to set LEDS_CLASS and NEW_LEDS. I will put these two into driver/video/backlight/Kconfig file and patch it so that you don't need to do it. 2012년 09월 08일 09:39, Randy Dunlap 쓴 글: On 09/06/2012 04:47 PM, a...@linux-foundation.org wrote: The mm-of-the-moment snapshot 2012-09-06-16-46 has been uploaded to http://www.ozlabs.org/~akpm/mmotm/ on x86_64: ERROR: "led_classdev_register" [drivers/video/backlight/lm3639_bl.ko] undefined! ERROR: "led_classdev_unregister" [drivers/video/backlight/lm3639_bl.ko] undefined! Full randconfig file is attached. -- 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/