max8952 44 drivers/regulator/max8952.c static int max8952_read_reg(struct max8952_data *max8952, u8 reg) max8952 46 drivers/regulator/max8952.c int ret = i2c_smbus_read_byte_data(max8952->client, reg); max8952 54 drivers/regulator/max8952.c static int max8952_write_reg(struct max8952_data *max8952, max8952 57 drivers/regulator/max8952.c return i2c_smbus_write_byte_data(max8952->client, reg, value); max8952 63 drivers/regulator/max8952.c struct max8952_data *max8952 = rdev_get_drvdata(rdev); max8952 68 drivers/regulator/max8952.c return (max8952->pdata->dvs_mode[selector] * 10 + 770) * 1000; max8952 73 drivers/regulator/max8952.c struct max8952_data *max8952 = rdev_get_drvdata(rdev); max8952 76 drivers/regulator/max8952.c if (max8952->vid0) max8952 78 drivers/regulator/max8952.c if (max8952->vid1) max8952 87 drivers/regulator/max8952.c struct max8952_data *max8952 = rdev_get_drvdata(rdev); max8952 89 drivers/regulator/max8952.c if (!max8952->vid0_gpiod || !max8952->vid1_gpiod) { max8952 94 drivers/regulator/max8952.c max8952->vid0 = selector & 0x1; max8952 95 drivers/regulator/max8952.c max8952->vid1 = (selector >> 1) & 0x1; max8952 96 drivers/regulator/max8952.c gpiod_set_value(max8952->vid0_gpiod, max8952->vid0); max8952 97 drivers/regulator/max8952.c gpiod_set_value(max8952->vid1_gpiod, max8952->vid1); max8952 180 drivers/regulator/max8952.c struct max8952_data *max8952; max8952 198 drivers/regulator/max8952.c max8952 = devm_kzalloc(&client->dev, sizeof(struct max8952_data), max8952 200 drivers/regulator/max8952.c if (!max8952) max8952 203 drivers/regulator/max8952.c max8952->client = client; max8952 204 drivers/regulator/max8952.c max8952->pdata = pdata; max8952 208 drivers/regulator/max8952.c config.driver_data = max8952; max8952 235 drivers/regulator/max8952.c max8952->vid0 = pdata->default_mode & 0x1; max8952 236 drivers/regulator/max8952.c max8952->vid1 = (pdata->default_mode >> 1) & 0x1; max8952 239 drivers/regulator/max8952.c gflags = max8952->vid0 ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; max8952 240 drivers/regulator/max8952.c max8952->vid0_gpiod = devm_gpiod_get_index_optional(&client->dev, max8952 243 drivers/regulator/max8952.c if (IS_ERR(max8952->vid0_gpiod)) max8952 244 drivers/regulator/max8952.c return PTR_ERR(max8952->vid0_gpiod); max8952 245 drivers/regulator/max8952.c gflags = max8952->vid1 ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; max8952 246 drivers/regulator/max8952.c max8952->vid1_gpiod = devm_gpiod_get_index_optional(&client->dev, max8952 249 drivers/regulator/max8952.c if (IS_ERR(max8952->vid1_gpiod)) max8952 250 drivers/regulator/max8952.c return PTR_ERR(max8952->vid1_gpiod); max8952 253 drivers/regulator/max8952.c if (!max8952->vid0_gpiod || !max8952->vid1_gpiod) { max8952 256 drivers/regulator/max8952.c max8952->vid0 = 0; max8952 257 drivers/regulator/max8952.c max8952->vid1 = 0; max8952 259 drivers/regulator/max8952.c if (max8952->vid0_gpiod) max8952 260 drivers/regulator/max8952.c gpiod_set_value(max8952->vid0_gpiod, 0); max8952 261 drivers/regulator/max8952.c if (max8952->vid1_gpiod) max8952 262 drivers/regulator/max8952.c gpiod_set_value(max8952->vid1_gpiod, 0); max8952 265 drivers/regulator/max8952.c max8952_write_reg(max8952, MAX8952_REG_CONTROL, 0x60); max8952 278 drivers/regulator/max8952.c max8952_write_reg(max8952, MAX8952_REG_CONTROL, 0x0); max8952 281 drivers/regulator/max8952.c max8952_write_reg(max8952, MAX8952_REG_MODE0, max8952 282 drivers/regulator/max8952.c (max8952_read_reg(max8952, max8952 285 drivers/regulator/max8952.c max8952_write_reg(max8952, MAX8952_REG_MODE1, max8952 286 drivers/regulator/max8952.c (max8952_read_reg(max8952, max8952 289 drivers/regulator/max8952.c max8952_write_reg(max8952, MAX8952_REG_MODE2, max8952 290 drivers/regulator/max8952.c (max8952_read_reg(max8952, max8952 293 drivers/regulator/max8952.c max8952_write_reg(max8952, MAX8952_REG_MODE3, max8952 294 drivers/regulator/max8952.c (max8952_read_reg(max8952, max8952 298 drivers/regulator/max8952.c max8952_write_reg(max8952, MAX8952_REG_SYNC, max8952 299 drivers/regulator/max8952.c (max8952_read_reg(max8952, MAX8952_REG_SYNC) & 0x3F) | max8952 301 drivers/regulator/max8952.c max8952_write_reg(max8952, MAX8952_REG_RAMP, max8952 302 drivers/regulator/max8952.c (max8952_read_reg(max8952, MAX8952_REG_RAMP) & 0x1F) | max8952 305 drivers/regulator/max8952.c i2c_set_clientdata(client, max8952);