Lines Matching refs:dev
34 struct device *dev;
49 dev_err(&client->dev, "failed reading at 0x%02x\n", reg);
64 dev_err(&client->dev, "failed writing 0x%02x to 0x%02x\n",
91 int adp5520_write(struct device *dev, int reg, uint8_t val)
93 return __adp5520_write(to_i2c_client(dev), reg, val);
97 int adp5520_read(struct device *dev, int reg, uint8_t *val)
99 return __adp5520_read(to_i2c_client(dev), reg, val);
103 int adp5520_set_bits(struct device *dev, int reg, uint8_t bit_mask)
105 struct adp5520_chip *chip = dev_get_drvdata(dev);
123 int adp5520_clr_bits(struct device *dev, int reg, uint8_t bit_mask)
125 struct adp5520_chip *chip = dev_get_drvdata(dev);
143 int adp5520_register_notifier(struct device *dev, struct notifier_block *nb,
146 struct adp5520_chip *chip = dev_get_drvdata(dev);
149 adp5520_set_bits(chip->dev, ADP5520_INTERRUPT_ENABLE,
161 int adp5520_unregister_notifier(struct device *dev, struct notifier_block *nb,
164 struct adp5520_chip *chip = dev_get_drvdata(dev);
166 adp5520_clr_bits(chip->dev, ADP5520_INTERRUPT_ENABLE,
196 static int __remove_subdev(struct device *dev, void *unused)
198 platform_device_unregister(to_platform_device(dev));
204 return device_for_each_child(chip->dev, NULL, __remove_subdev);
210 struct adp5520_platform_data *pdata = dev_get_platdata(&client->dev);
217 dev_err(&client->dev, "SMBUS Word Data not Supported\n");
222 dev_err(&client->dev, "missing platform data\n");
226 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
233 chip->dev = &client->dev;
245 dev_err(&client->dev, "failed to request irq %d\n",
251 ret = adp5520_write(chip->dev, ADP5520_MODE_STATUS, ADP5520_nSTNBY);
253 dev_err(&client->dev, "failed to write\n");
258 pdev = platform_device_register_data(chip->dev, "adp5520-keys",
267 pdev = platform_device_register_data(chip->dev, "adp5520-gpio",
276 pdev = platform_device_register_data(chip->dev, "adp5520-led",
285 pdev = platform_device_register_data(chip->dev,
308 static int adp5520_suspend(struct device *dev)
310 struct i2c_client *client = to_i2c_client(dev);
311 struct adp5520_chip *chip = dev_get_drvdata(&client->dev);
313 adp5520_read(chip->dev, ADP5520_MODE_STATUS, &chip->mode);
316 adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0);
320 static int adp5520_resume(struct device *dev)
322 struct i2c_client *client = to_i2c_client(dev);
323 struct adp5520_chip *chip = dev_get_drvdata(&client->dev);
325 adp5520_write(chip->dev, ADP5520_MODE_STATUS, chip->mode);