Skip to content

Commit

Permalink
mfd: ti-lmu: Add LM36274 support to the ti-lmu
Browse files Browse the repository at this point in the history
Add the LM36274 register support to the ti-lmu MFD driver.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
  • Loading branch information
Dan Murphy authored and Jacek Anaszewski committed Jun 6, 2019
1 parent 4665743 commit 9c523ef
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/mfd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1335,9 +1335,8 @@ config MFD_TI_LMU
select REGMAP_I2C
help
Say yes here to enable support for TI LMU chips.

TI LMU MFD supports LM3532, LM3631, LM3632, LM3633, and LM3695.
It consists of backlight, LED and regulator driver.
TI LMU MFD supports LM3532, LM3631, LM3632, LM3633, LM3695 and
LM36274. It consists of backlight, LED and regulator driver.
It provides consistent device controls for lighting functions.

config MFD_OMAP_USB_HOST
Expand Down
14 changes: 14 additions & 0 deletions drivers/mfd/ti-lmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ static const struct mfd_cell lm3695_devices[] = {
},
};

static const struct mfd_cell lm36274_devices[] = {
LM363X_REGULATOR(LM36274_BOOST),
LM363X_REGULATOR(LM36274_LDO_POS),
LM363X_REGULATOR(LM36274_LDO_NEG),
{
.name = "lm36274-leds",
.id = LM36274,
.of_compatible = "ti,lm36274-backlight",
},
};

#define TI_LMU_DATA(chip, max_reg) \
static const struct ti_lmu_data chip##_data = \
{ \
Expand All @@ -123,6 +134,7 @@ TI_LMU_DATA(lm3631, LM3631_MAX_REG);
TI_LMU_DATA(lm3632, LM3632_MAX_REG);
TI_LMU_DATA(lm3633, LM3633_MAX_REG);
TI_LMU_DATA(lm3695, LM3695_MAX_REG);
TI_LMU_DATA(lm36274, LM36274_MAX_REG);

static int ti_lmu_probe(struct i2c_client *cl, const struct i2c_device_id *id)
{
Expand Down Expand Up @@ -191,6 +203,7 @@ static const struct of_device_id ti_lmu_of_match[] = {
{ .compatible = "ti,lm3632", .data = &lm3632_data },
{ .compatible = "ti,lm3633", .data = &lm3633_data },
{ .compatible = "ti,lm3695", .data = &lm3695_data },
{ .compatible = "ti,lm36274", .data = &lm36274_data },
{ }
};
MODULE_DEVICE_TABLE(of, ti_lmu_of_match);
Expand All @@ -200,6 +213,7 @@ static const struct i2c_device_id ti_lmu_ids[] = {
{ "lm3632", LM3632 },
{ "lm3633", LM3633 },
{ "lm3695", LM3695 },
{ "lm36274", LM36274 },
{ }
};
MODULE_DEVICE_TABLE(i2c, ti_lmu_ids);
Expand Down
23 changes: 23 additions & 0 deletions include/linux/mfd/ti-lmu-register.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,27 @@
#define LM3695_REG_BRT_MSB 0x14

#define LM3695_MAX_REG 0x14

/* LM36274 */
#define LM36274_REG_REV 0x01
#define LM36274_REG_BL_CFG_1 0x02
#define LM36274_REG_BL_CFG_2 0x03
#define LM36274_REG_BRT_LSB 0x04
#define LM36274_REG_BRT_MSB 0x05
#define LM36274_REG_BL_EN 0x08

#define LM36274_REG_BIAS_CONFIG_1 0x09
#define LM36274_EXT_EN_MASK BIT(0)
#define LM36274_EN_VNEG_MASK BIT(1)
#define LM36274_EN_VPOS_MASK BIT(2)

#define LM36274_REG_BIAS_CONFIG_2 0x0a
#define LM36274_REG_BIAS_CONFIG_3 0x0b
#define LM36274_REG_VOUT_BOOST 0x0c
#define LM36274_REG_VOUT_POS 0x0d
#define LM36274_REG_VOUT_NEG 0x0e
#define LM36274_VOUT_MASK 0x3F

#define LM36274_MAX_REG 0x13

#endif
4 changes: 4 additions & 0 deletions include/linux/mfd/ti-lmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ enum ti_lmu_id {
LM3632,
LM3633,
LM3695,
LM36274,
LMU_MAX_ID,
};

Expand Down Expand Up @@ -67,6 +68,9 @@ enum lm363x_regulator_id {
LM3632_BOOST, /* Boost output */
LM3632_LDO_POS, /* Positive display bias output */
LM3632_LDO_NEG, /* Negative display bias output */
LM36274_BOOST, /* Boost output */
LM36274_LDO_POS, /* Positive display bias output */
LM36274_LDO_NEG, /* Negative display bias output */
};

/**
Expand Down

0 comments on commit 9c523ef

Please sign in to comment.