backlight: lp855x: move backlight mode platform data

The brightness of LP855x devices is controlled by I2C register or PWM
input .  This mode was selected through the platform data, but it can be
chosen by the driver internally without platform data configuration.

How to decide the control mode:
  If the PWM period has specific value, the mode is PWM input.
  On the other hand, the mode is register-based.
  This mode selection is done on the _probe().

Move 'mode' from a header file to the driver private data structure,
'lp855 x'.  And correlated code was replaced.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Kim, Milo 2013-04-29 16:18:03 -07:00 committed by Linus Torvalds
parent 600ffd33d0
commit 0b81857339
3 changed files with 15 additions and 16 deletions

View file

@ -69,11 +69,6 @@ enum lp855x_chip_id {
LP8557,
};
enum lp855x_brightness_ctrl_mode {
PWM_BASED = 1,
REGISTER_BASED,
};
enum lp8550_brighntess_source {
LP8550_PWM_ONLY,
LP8550_I2C_ONLY = 2,
@ -116,7 +111,6 @@ struct lp855x_rom_data {
/**
* struct lp855x_platform_data
* @name : Backlight driver name. If it is not defined, default name is set.
* @mode : brightness control by pwm or lp855x register
* @device_control : value of DEVICE CONTROL register
* @initial_brightness : initial value of backlight brightness
* @period_ns : platform specific pwm period value. unit is nano.
@ -129,7 +123,6 @@ struct lp855x_rom_data {
*/
struct lp855x_platform_data {
const char *name;
enum lp855x_brightness_ctrl_mode mode;
u8 device_control;
int initial_brightness;
unsigned int period_ns;