lm3630a_bl.c (cf40a76e7d5874bb25f4404eecc58a2e033af885) | lm3630a_bl.c (d3f48ec0954c6aac736ab21c34a35d7554409112) |
---|---|
1/* 2* Simple driver for Texas Instruments LM3630A Backlight driver chip 3* Copyright (C) 2012 Texas Instruments 4* 5* This program is free software; you can redistribute it and/or modify 6* it under the terms of the GNU General Public License version 2 as 7* published by the Free Software Foundation. 8* --- 187 unchanged lines hidden (view full) --- 196 ret = lm3630a_write(pchip, REG_BRT_A, bl->props.brightness); 197 if (bl->props.brightness < 0x4) 198 ret |= lm3630a_update(pchip, REG_CTRL, LM3630A_LEDA_ENABLE, 0); 199 else 200 ret |= lm3630a_update(pchip, REG_CTRL, 201 LM3630A_LEDA_ENABLE, LM3630A_LEDA_ENABLE); 202 if (ret < 0) 203 goto out_i2c_err; | 1/* 2* Simple driver for Texas Instruments LM3630A Backlight driver chip 3* Copyright (C) 2012 Texas Instruments 4* 5* This program is free software; you can redistribute it and/or modify 6* it under the terms of the GNU General Public License version 2 as 7* published by the Free Software Foundation. 8* --- 187 unchanged lines hidden (view full) --- 196 ret = lm3630a_write(pchip, REG_BRT_A, bl->props.brightness); 197 if (bl->props.brightness < 0x4) 198 ret |= lm3630a_update(pchip, REG_CTRL, LM3630A_LEDA_ENABLE, 0); 199 else 200 ret |= lm3630a_update(pchip, REG_CTRL, 201 LM3630A_LEDA_ENABLE, LM3630A_LEDA_ENABLE); 202 if (ret < 0) 203 goto out_i2c_err; |
204 return bl->props.brightness; | 204 return 0; |
205 206out_i2c_err: 207 dev_err(pchip->dev, "i2c failed to access\n"); 208 return bl->props.brightness; 209} 210 211static int lm3630a_bank_a_get_brightness(struct backlight_device *bl) 212{ --- 60 unchanged lines hidden (view full) --- 273 ret = lm3630a_write(pchip, REG_BRT_B, bl->props.brightness); 274 if (bl->props.brightness < 0x4) 275 ret |= lm3630a_update(pchip, REG_CTRL, LM3630A_LEDB_ENABLE, 0); 276 else 277 ret |= lm3630a_update(pchip, REG_CTRL, 278 LM3630A_LEDB_ENABLE, LM3630A_LEDB_ENABLE); 279 if (ret < 0) 280 goto out_i2c_err; | 205 206out_i2c_err: 207 dev_err(pchip->dev, "i2c failed to access\n"); 208 return bl->props.brightness; 209} 210 211static int lm3630a_bank_a_get_brightness(struct backlight_device *bl) 212{ --- 60 unchanged lines hidden (view full) --- 273 ret = lm3630a_write(pchip, REG_BRT_B, bl->props.brightness); 274 if (bl->props.brightness < 0x4) 275 ret |= lm3630a_update(pchip, REG_CTRL, LM3630A_LEDB_ENABLE, 0); 276 else 277 ret |= lm3630a_update(pchip, REG_CTRL, 278 LM3630A_LEDB_ENABLE, LM3630A_LEDB_ENABLE); 279 if (ret < 0) 280 goto out_i2c_err; |
281 return bl->props.brightness; | 281 return 0; |
282 283out_i2c_err: 284 dev_err(pchip->dev, "i2c failed to access REG_CTRL\n"); 285 return bl->props.brightness; 286} 287 288static int lm3630a_bank_b_get_brightness(struct backlight_device *bl) 289{ --- 200 unchanged lines hidden --- | 282 283out_i2c_err: 284 dev_err(pchip->dev, "i2c failed to access REG_CTRL\n"); 285 return bl->props.brightness; 286} 287 288static int lm3630a_bank_b_get_brightness(struct backlight_device *bl) 289{ --- 200 unchanged lines hidden --- |