Lines Matching defs:i2c
10 #include <linux/i2c.h>
180 static int rn5t618_i2c_probe(struct i2c_client *i2c)
186 of_id = of_match_device(rn5t618_of_match, &i2c->dev);
188 dev_err(&i2c->dev, "Failed to find matching DT ID\n");
192 priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL);
196 i2c_set_clientdata(i2c, priv);
198 priv->irq = i2c->irq;
199 priv->dev = &i2c->dev;
201 priv->regmap = devm_regmap_init_i2c(i2c, &rn5t618_regmap_config);
204 dev_err(&i2c->dev, "regmap init failed: %d\n", ret);
209 ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE,
214 ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_NONE,
219 dev_err(&i2c->dev, "failed to add sub-devices: %d\n", ret);
223 rn5t618_pm_power_off = i2c;
224 if (of_device_is_system_power_controller(i2c->dev.of_node)) {
228 dev_warn(&i2c->dev, "Poweroff callback already assigned\n");
236 dev_err(&i2c->dev, "cannot register restart handler, %d\n", ret);
243 static void rn5t618_i2c_remove(struct i2c_client *i2c)
245 if (i2c == rn5t618_pm_power_off) {