diff options
author | Danny Nold <dannynold@freescale.com> | 2010-08-17 14:50:44 -0500 |
---|---|---|
committer | Danny Nold <dannynold@freescale.com> | 2010-08-18 10:15:49 -0500 |
commit | 5e70cd1074b1654bde1e26ae0b40aa89e1b0e472 (patch) | |
tree | cd35873d1b44d1268f567292da927537c248570a /arch | |
parent | a9dd14fb1e3b626a46b9d4ee9b56b0fc05bc9ee4 (diff) |
ENGR00126327-1 - MSL: Add command line parsing of MAX17135 params
Add support for Maxim17135 EPD PMIC command line parameters:
- One for PMIC pass version (currently just 1 or 2)
- One for VCOM setting
Signed-off-by: Danny Nold <dannynold@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-mx5/mx50_arm2.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/mx50_arm2.c b/arch/arm/mach-mx5/mx50_arm2.c index 56fdfd6c5a78..95579541ea2a 100644 --- a/arch/arm/mach-mx5/mx50_arm2.c +++ b/arch/arm/mach-mx5/mx50_arm2.c @@ -699,6 +699,36 @@ static struct max17135_platform_data max17135_pdata __initdata = { .regulator_init = max17135_init_data, }; +static int __initdata max17135_pass_num = { 1 }; +static int __initdata max17135_vcom = { -1250000 }; +/* + * Parse user specified options (`max17135:') + * example: + * max17135:pass=2,vcom=-1250000 + */ +static int __init max17135_setup(char *options) +{ + char *opt; + while ((opt = strsep(&options, ",")) != NULL) { + if (!*opt) + continue; + if (!strncmp(opt, "pass=", 5)) + max17135_pass_num = + simple_strtoul(opt + 5, NULL, 0); + if (!strncmp(opt, "vcom=", 5)) { + int offs = 5; + if (opt[5] == '-') + offs = 6; + max17135_vcom = + simple_strtoul(opt + offs, NULL, 0); + max17135_vcom = -max17135_vcom; + } + } + return 1; +} + +__setup("max17135:", max17135_setup); + static struct i2c_board_info mxc_i2c1_board_info[] __initdata = { { .type = "sgtl5000-i2c", @@ -1062,6 +1092,8 @@ static void __init mxc_board_init(void) ARRAY_SIZE(mxc_dataflash_device)); i2c_register_board_info(1, mxc_i2c1_board_info, ARRAY_SIZE(mxc_i2c1_board_info)); + max17135_pdata.pass_num = max17135_pass_num; + max17135_pdata.vcom_uV = max17135_vcom; i2c_register_board_info(2, mxc_i2c2_board_info, ARRAY_SIZE(mxc_i2c2_board_info)); |