@@ -92,7 +92,7 @@ static int lm3630a_chip_init(struct lm3630a_chip *pchip)
/* set Cofig. register */
rval |= lm3630a_update(pchip, REG_CONFIG, 0x07, pdata->pwm_ctrl);
/* set boost control */
- rval |= lm3630a_write(pchip, REG_BOOST, 0x38);
+ rval |= lm3630a_write(pchip, REG_BOOST, pdata->boost_ctrl);
/* set current A */
rval |= lm3630a_update(pchip, REG_I_A, 0x1F, 0x1F);
/* set current B */
@@ -528,6 +528,13 @@ static int lm3630a_probe(struct i2c_client *client)
pdata->ledb_max_brt = LM3630A_MAX_BRIGHTNESS;
pdata->leda_init_brt = LM3630A_MAX_BRIGHTNESS;
pdata->ledb_init_brt = LM3630A_MAX_BRIGHTNESS;
+ pdata->boost_ctrl = LM3630A_BOOST_CTRL_DEFAULT;
+
+ if (device_property_read_bool(pchip->dev, "ti,boost_frequency_shift"))
+ pdata->boost_ctrl |= LM3630A_BOOST_SHIFT_FREQ;
+
+ if (device_property_read_bool(pchip->dev, "ti,boost_use_1mhz"))
+ pdata->boost_ctrl |= LM3630A_BOOST_USE_1MHZ;
rval = lm3630a_parse_node(pchip, pdata);
if (rval) {
@@ -33,6 +33,9 @@ enum lm3630a_ledb_ctrl {
};
#define LM3630A_MAX_BRIGHTNESS 255
+#define LM3630A_BOOST_CTRL_DEFAULT 0x38
+#define LM3630A_BOOST_USE_1MHZ BIT(0)
+#define LM3630A_BOOST_SHIFT_FREQ BIT(1)
/*
*@leda_label : optional led a label.
*@leda_init_brt : led a init brightness. 4~255
@@ -44,6 +47,7 @@ enum lm3630a_ledb_ctrl {
*@ledb_ctrl : led b disable, enable linear, enable exponential
*@pwm_period : pwm period
*@pwm_ctrl : pwm disable, bank a or b, active high or low
+ *@boost_ctrl : boost converter control
*/
struct lm3630a_platform_data {
@@ -60,6 +64,7 @@ struct lm3630a_platform_data {
/* pwm config. */
unsigned int pwm_period;
enum lm3630a_pwm_ctrl pwm_ctrl;
+ unsigned int boost_ctrl;
};
#endif /* __LINUX_LM3630A_H */