Source
x
static int ti_lmu_probe(struct i2c_client *cl, const struct i2c_device_id *id)
/*
* TI LMU (Lighting Management Unit) Core Driver
*
* Copyright 2017 Texas Instruments
*
* Author: Milo Kim <milo.kim@ti.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
struct ti_lmu_data {
const struct mfd_cell *cells;
int num_cells;
unsigned int max_register;
};
static int ti_lmu_enable_hw(struct ti_lmu *lmu, enum ti_lmu_id id)
{
if (lmu->en_gpio)
gpiod_set_value(lmu->en_gpio, 1);
/* Delay about 1ms after HW enable pin control */
usleep_range(1000, 1500);
/* LM3631 has additional power up sequence - enable LCD_EN bit. */
if (id == LM3631) {
return regmap_update_bits(lmu->regmap, LM3631_REG_DEVCTRL,
LM3631_LCD_EN_MASK,
LM3631_LCD_EN_MASK);
}
return 0;
}
static void ti_lmu_disable_hw(void *data)
{
struct ti_lmu *lmu = data;
if (lmu->en_gpio)
gpiod_set_value(lmu->en_gpio, 0);
}
static const struct mfd_cell lm3532_devices[] = {
{
.name = "ti-lmu-backlight",
.id = LM3532,
.of_compatible = "ti,lm3532-backlight",
},
};
LM363X_REGULATOR(LM3631_BOOST),
LM363X_REGULATOR(LM3631_LDO_CONT),
LM363X_REGULATOR(LM3631_LDO_OREF),
LM363X_REGULATOR(LM3631_LDO_POS),
LM363X_REGULATOR(LM3631_LDO_NEG),
{
.name = "ti-lmu-backlight",
.id = LM3631,
.of_compatible = "ti,lm3631-backlight",
},
};
static const struct mfd_cell lm3632_devices[] = {
LM363X_REGULATOR(LM3632_BOOST),
LM363X_REGULATOR(LM3632_LDO_POS),
LM363X_REGULATOR(LM3632_LDO_NEG),
{
.name = "ti-lmu-backlight",
.id = LM3632,
.of_compatible = "ti,lm3632-backlight",