• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/regulator/

Lines Matching defs:max1586

2  * max1586.c  --  Voltage and current regulation for the Maxim 1586
26 #include <linux/regulator/max1586.h>
52 * On I2C bus, sending a "x" byte to the max1586 means :
58 static int max1586_v3_calc_voltage(struct max1586_data *max1586,
61 unsigned range_uV = max1586->max_uV - max1586->min_uV;
63 return max1586->min_uV + (selector * range_uV / MAX1586_V3_MAX_VSEL);
68 struct max1586_data *max1586 = rdev_get_drvdata(rdev);
69 struct i2c_client *client = max1586->client;
70 unsigned range_uV = max1586->max_uV - max1586->min_uV;
74 if (min_uV > max1586->max_uV || max_uV < max1586->min_uV)
76 if (min_uV < max1586->min_uV)
77 min_uV = max1586->min_uV;
79 selector = ((min_uV - max1586->min_uV) * MAX1586_V3_MAX_VSEL +
81 if (max1586_v3_calc_voltage(max1586, selector) > max_uV)
85 max1586_v3_calc_voltage(max1586, selector) / 1000);
93 struct max1586_data *max1586 = rdev_get_drvdata(rdev);
97 return max1586_v3_calc_voltage(max1586, selector);
102 * On I2C bus, sending a "x" byte to the max1586 means :
188 struct max1586_data *max1586;
191 max1586 = kzalloc(sizeof(struct max1586_data) +
194 if (!max1586)
197 max1586->client = client;
203 max1586->min_uV = MAX1586_V3_MIN_UV / 1000 * pdata->v3_gain / 1000;
204 max1586->max_uV = MAX1586_V3_MAX_UV / 1000 * pdata->v3_gain / 1000;
206 rdev = max1586->rdev;
217 max1586);
226 i2c_set_clientdata(client, max1586);
234 kfree(max1586);
241 struct max1586_data *max1586 = i2c_get_clientdata(client);
245 if (max1586->rdev[i])
246 regulator_unregister(max1586->rdev[i]);
247 kfree(max1586);
253 { "max1586", 0 },
262 .name = "max1586",