summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/lm3560.c
AgeCommit message (Collapse)AuthorFilesLines
2014-09-04[media] lm3560: simplify boolean testsMauro Carvalho Chehab1-2/+2
Instead of using if (on == true), just use if (on). That allows a faster mental parsing when analyzing the code. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11[media] lm3560: prevent memory leak in case of pdata absenceAndy Shevchenko1-2/+1
If we have no pdata defined and driver fails to register we leak memory. Converting to devm_kzalloc prevents this to happen. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11[media] lm3560: keep style for the commentsAndy Shevchenko1-5/+8
Let's keep the style for all comments in the code, namely using small letters whenever it's possible. There is no functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11[media] lm3560: remove FSF address from the licenseAndy Shevchenko1-6/+0
There is no need to keep the FSF address inside each file. Moreover, it might change in future which will make this one obsolete. There is no functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-10[media] media: i2c: lm3560: use correct clientdata in lm3560_remove()Wei Yongjun1-3/+3
We had set the i2c clientdata to &flash->subdev_led[LM3560_LED1] after call lm3560_subdev_init(flash, LM3560_LED1, "lm3560-led1"), but the container_of() in lm3560_remove() return the wrong pointer to flash.(should be container_of(subdev, struct lm3560_flash, subdev_led[LM3560_LED_MAX-1]) This patch fix to set i2c clientdata to flash so we can get flash from clientdata directly. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-10[media] media: i2c: lm3560: fix missing unlock on error in lm3560_set_ctrl()Wei Yongjun1-5/+9
Add the missing unlock before return from function lm3560_set_ctrl() in the error handling case. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-09[media] media: i2c: lm3560: fix missing unlock on error, fault handlingDaniel Jeong1-7/+7
Correct reference of reading values. (rval -> reg_val) Add the missing unlock before return from function lm3560_get_ctrl() to avoid deadlock. Thank you Dan Carpenter & Sakari. Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-10-31[media] media: i2c: add driver for dual LED Flash, lm3560Daniel Jeong1-0/+488
Adds the driver for the LM3560, dual LED Flash The LM3560 has two 1A constant current driver for high current white LEDs. It is controlled via an I2C compatible interface(up to 400kHz). Each flash brightness, torch brightness and enable/disable can be controlled independantly, but flash timeout and operation mode are shared. Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>