Lines Matching full:ec
150 struct ntxec *ec; in ntxec_probe() local
156 ec = devm_kmalloc(&client->dev, sizeof(*ec), GFP_KERNEL); in ntxec_probe()
157 if (!ec) in ntxec_probe()
160 ec->dev = &client->dev; in ntxec_probe()
162 ec->regmap = devm_regmap_init_i2c(client, ®map_config); in ntxec_probe()
163 if (IS_ERR(ec->regmap)) { in ntxec_probe()
164 dev_err(ec->dev, "Failed to set up regmap for device\n"); in ntxec_probe()
165 return PTR_ERR(ec->regmap); in ntxec_probe()
169 res = regmap_read(ec->regmap, NTXEC_REG_VERSION, &version); in ntxec_probe()
171 dev_err(ec->dev, "Failed to read firmware version number\n"); in ntxec_probe()
185 ec->regmap = devm_regmap_init(ec->dev, NULL, in ntxec_probe()
186 ec->regmap, in ntxec_probe()
188 if (IS_ERR(ec->regmap)) in ntxec_probe()
189 return PTR_ERR(ec->regmap); in ntxec_probe()
192 dev_err(ec->dev, in ntxec_probe()
198 dev_info(ec->dev, in ntxec_probe()
201 if (of_device_is_system_power_controller(ec->dev->of_node)) { in ntxec_probe()
206 res = regmap_write(ec->regmap, NTXEC_REG_POWERKEEP, in ntxec_probe()
216 dev_err(ec->dev, "poweroff_restart_client already assigned\n"); in ntxec_probe()
222 dev_err(ec->dev, "pm_power_off already assigned\n"); in ntxec_probe()
228 dev_err(ec->dev, in ntxec_probe()
232 i2c_set_clientdata(client, ec); in ntxec_probe()
234 res = devm_mfd_add_devices(ec->dev, PLATFORM_DEVID_NONE, in ntxec_probe()
237 dev_err(ec->dev, "Failed to add subdevices: %d\n", res); in ntxec_probe()
268 MODULE_DESCRIPTION("Core driver for Netronix EC");