Lines Matching refs:max77843

68 static int max77843_chg_init(struct max77693_dev *max77843)  in max77843_chg_init()  argument
72 max77843->i2c_chg = i2c_new_dummy_device(max77843->i2c->adapter, I2C_ADDR_CHG); in max77843_chg_init()
73 if (IS_ERR(max77843->i2c_chg)) { in max77843_chg_init()
74 dev_err(&max77843->i2c->dev, in max77843_chg_init()
76 return PTR_ERR(max77843->i2c_chg); in max77843_chg_init()
78 i2c_set_clientdata(max77843->i2c_chg, max77843); in max77843_chg_init()
80 max77843->regmap_chg = devm_regmap_init_i2c(max77843->i2c_chg, in max77843_chg_init()
82 if (IS_ERR(max77843->regmap_chg)) { in max77843_chg_init()
83 ret = PTR_ERR(max77843->regmap_chg); in max77843_chg_init()
90 i2c_unregister_device(max77843->i2c_chg); in max77843_chg_init()
98 struct max77693_dev *max77843; in max77843_probe() local
102 max77843 = devm_kzalloc(&i2c->dev, sizeof(*max77843), GFP_KERNEL); in max77843_probe()
103 if (!max77843) in max77843_probe()
106 i2c_set_clientdata(i2c, max77843); in max77843_probe()
107 max77843->dev = &i2c->dev; in max77843_probe()
108 max77843->i2c = i2c; in max77843_probe()
109 max77843->irq = i2c->irq; in max77843_probe()
110 max77843->type = id->driver_data; in max77843_probe()
112 max77843->regmap = devm_regmap_init_i2c(i2c, in max77843_probe()
114 if (IS_ERR(max77843->regmap)) { in max77843_probe()
116 return PTR_ERR(max77843->regmap); in max77843_probe()
119 ret = regmap_add_irq_chip(max77843->regmap, max77843->irq, in max77843_probe()
121 0, &max77843_irq_chip, &max77843->irq_data_topsys); in max77843_probe()
127 ret = regmap_read(max77843->regmap, in max77843_probe()
135 ret = max77843_chg_init(max77843); in max77843_probe()
141 ret = regmap_update_bits(max77843->regmap, in max77843_probe()
150 ret = mfd_add_devices(max77843->dev, -1, max77843_devs, in max77843_probe()
157 device_init_wakeup(max77843->dev, true); in max77843_probe()
162 regmap_del_irq_chip(max77843->irq, max77843->irq_data_topsys); in max77843_probe()
180 struct max77693_dev *max77843 = i2c_get_clientdata(i2c); in max77843_suspend() local
182 disable_irq(max77843->irq); in max77843_suspend()
184 enable_irq_wake(max77843->irq); in max77843_suspend()
192 struct max77693_dev *max77843 = i2c_get_clientdata(i2c); in max77843_resume() local
195 disable_irq_wake(max77843->irq); in max77843_resume()
196 enable_irq(max77843->irq); in max77843_resume()