Lines Matching refs:stw481x

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