Source
x
static int twl6030smps_list_voltage(struct regulator_dev *rdev, unsigned index)
/*
* Split TWL6030 logic from twl-regulator.c:
* Copyright (C) 2008 David Brownell
*
* Copyright (C) 2016 Nicolae Rosia <nicolae.rosia@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
struct twlreg_info {
/* start of regulator's PM_RECEIVER control register bank */
u8 base;
/* twl resource ID, for resource control state machine */
u8 id;
u8 flags;
/* used by regulator core */
struct regulator_desc desc;
/* chip specific features */
unsigned long features;
/* data passed from board for external get/set voltage */
void *data;
};
/* LDO control registers ... offset is from the base of its register bank.
* The first three registers of all power resource banks help hardware to
* manage the various resource groups.
*/
/* Common offset in TWL4030/6030 */
/* TWL6030 register offsets */
/* TWL6030 Misc register offsets */
/* TWL6030 LDO register values for CFG_STATE */
/* Flags for SMPS Voltage reading */
/* twl6032 SMPS EPROM values */
static inline int
twlreg_read(struct twlreg_info *info, unsigned slave_subgp, unsigned offset)
{
u8 value;
int status;
status = twl_i2c_read_u8(slave_subgp,