Lines Matching refs:stw481x

15 #include <linux/mfd/stw481x.h>
34 * @stw481x: handle to the stw481x chip
44 static int stw481x_get_pctl_reg(struct stw481x *stw481x, u8 reg)
52 ret = regmap_write(stw481x->map, STW_PCTL_REG_HI, msb);
55 ret = regmap_write(stw481x->map, STW_PCTL_REG_LO, lsb);
58 ret = regmap_read(stw481x->map, STW_PCTL_REG_HI, &val);
62 ret = regmap_read(stw481x->map, STW_PCTL_REG_LO, &val);
71 static int stw481x_startup(struct stw481x *stw481x)
89 ret = regmap_read(stw481x->map, STW_CONF1, &val);
95 dev_info(&stw481x->client->dev, "voltages %s\n",
97 dev_info(&stw481x->client->dev, "MMC level shifter %s\n",
99 dev_info(&stw481x->client->dev, "VMMC: %s\n",
102 dev_info(&stw481x->client->dev, "STw481x power control registers:\n");
104 ret = stw481x_get_pctl_reg(stw481x, STW_PC_VCORE_SEL);
109 ret = stw481x_get_pctl_reg(stw481x, STW_PC_VAUX_SEL);
115 ret = stw481x_get_pctl_reg(stw481x, STW_PC_VPLL_SEL);
120 dev_info(&stw481x->client->dev, "VCORE: %u.%uV %s\n",
124 dev_info(&stw481x->client->dev, "VPLL: %u.%uV %s\n",
128 dev_info(&stw481x->client->dev, "VAUX: %u.%uV %s\n",
132 ret = regmap_read(stw481x->map, STW_CONF2, &val);
136 dev_info(&stw481x->client->dev, "TWARN: %s threshold, %s\n",
140 dev_info(&stw481x->client->dev, "VMMC: %s\n",
142 dev_info(&stw481x->client->dev, "IT WAKE UP: %s\n",
144 dev_info(&stw481x->client->dev, "GPO1: %s\n",
146 dev_info(&stw481x->client->dev, "GPO2: %s\n",
149 ret = regmap_read(stw481x->map, STW_VCORE_SLEEP, &val);
153 dev_info(&stw481x->client->dev, "VCORE SLEEP: %u.%uV\n",
165 .of_compatible = "st,stw481x-vmmc",
166 .name = "stw481x-vmmc-regulator",
178 struct stw481x *stw481x;
182 stw481x = devm_kzalloc(&client->dev, sizeof(*stw481x), GFP_KERNEL);
183 if (!stw481x)
186 i2c_set_clientdata(client, stw481x);
187 stw481x->client = client;
188 stw481x->map = devm_regmap_init_i2c(client, &stw481x_regmap_config);
189 if (IS_ERR(stw481x->map)) {
190 ret = PTR_ERR(stw481x->map);
196 ret = stw481x_startup(stw481x);
205 stw481x_cells[i].platform_data = stw481x;
206 stw481x_cells[i].pdata_size = sizeof(*stw481x);
225 { "stw481x", 0 },
239 .name = "stw481x",