Source
x
static unsigned int hi6421_regulator_buck_get_mode(struct regulator_dev *rdev)
/*
* Device driver for regulators in Hi6421 IC
*
* Copyright (c) <2011-2014> HiSilicon Technologies Co., Ltd.
* http://www.hisilicon.com
* Copyright (c) <2013-2014> Linaro Ltd.
* http://www.linaro.org
*
* Author: Guodong Xu <guodong.xu@linaro.org>
*
* 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 hi6421_regulator_pdata - Hi6421 regulator data of platform device
* @lock: mutex to serialize regulator enable
*/
struct hi6421_regulator_pdata {
struct mutex lock;
};
/*
* struct hi6421_regulator_info - hi6421 regulator information
* @desc: regulator description
* @mode_mask: ECO mode bitmask of LDOs; for BUCKs, this masks sleep
* @eco_microamp: eco mode load upper limit (in uA), valid for LDOs only
*/
struct hi6421_regulator_info {
struct regulator_desc desc;
u8 mode_mask;
u32 eco_microamp;
};
/* HI6421 regulators */
enum hi6421_regulator_id {
HI6421_LDO0,
HI6421_LDO1,
HI6421_LDO2,
HI6421_LDO3,
HI6421_LDO4,
HI6421_LDO5,
HI6421_LDO6,
HI6421_LDO7,
HI6421_LDO8,
HI6421_LDO9,
HI6421_LDO10,
HI6421_LDO11,
HI6421_LDO12,
HI6421_LDO13,
HI6421_LDO14,
HI6421_LDO15,
HI6421_LDO16,
HI6421_LDO17,
HI6421_LDO18,
HI6421_LDO19,
HI6421_LDO20,
HI6421_LDOAUDIO,
HI6421_BUCK0,
HI6421_BUCK1,
HI6421_BUCK2,
HI6421_BUCK3,
HI6421_BUCK4,
HI6421_BUCK5,
HI6421_NUM_REGULATORS,
};
static struct of_regulator_match hi6421_regulator_match[] = {
HI6421_REGULATOR_OF_MATCH(hi6421_vout0, LDO0),
HI6421_REGULATOR_OF_MATCH(hi6421_vout1, LDO1),
HI6421_REGULATOR_OF_MATCH(hi6421_vout2, LDO2),
HI6421_REGULATOR_OF_MATCH(hi6421_vout3, LDO3),
HI6421_REGULATOR_OF_MATCH(hi6421_vout4, LDO4),