Source
x
ab3100_regulator_of_probe(struct platform_device *pdev, struct device_node *np)
/*
* drivers/regulator/ab3100.c
*
* Copyright (C) 2008-2009 ST-Ericsson AB
* License terms: GNU General Public License (GPL) version 2
* Low-level control of the AB3100 IC Low Dropout (LDO)
* regulators, external regulator and buck converter
* Author: Mattias Wallin <mattias.wallin@stericsson.com>
* Author: Linus Walleij <linus.walleij@stericsson.com>
*/
/* LDO registers and some handy masking definitions for AB3100 */
/**
* struct ab3100_regulator
* A struct passed around the individual regulator functions
* @platform_device: platform device holding this regulator
* @dev: handle to the device
* @plfdata: AB3100 platform data passed in at probe time
* @regreg: regulator register number in the AB3100
*/
struct ab3100_regulator {
struct regulator_dev *rdev;
struct device *dev;
struct ab3100_platform_data *plfdata;
u8 regreg;
};
/* The order in which registers are initialized */
static const u8 ab3100_reg_init_order[AB3100_NUM_REGULATORS+2] = {
AB3100_LDO_A,
AB3100_LDO_C,
AB3100_LDO_E,
AB3100_LDO_E_SLEEP,
AB3100_LDO_F,
AB3100_LDO_G,
AB3100_LDO_H,
AB3100_LDO_K,
AB3100_LDO_EXT,
AB3100_BUCK,
AB3100_BUCK_SLEEP,
AB3100_LDO_D,
};
/* Preset (hardware defined) voltages for these regulators */
static const unsigned int ldo_e_buck_typ_voltages[] = {
1800000,
1400000,
1300000,
1200000,
1100000,
1050000,
900000,
};
static const unsigned int ldo_f_typ_voltages[] = {
1800000,
1400000,
1300000,
1200000,