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()
186 ec->regmap = devm_regmap_init(ec->dev, NULL, in ntxec_probe()
187 ec->regmap, in ntxec_probe()
189 if (IS_ERR(ec->regmap)) in ntxec_probe()
190 return PTR_ERR(ec->regmap); in ntxec_probe()
193 dev_err(ec->dev, in ntxec_probe()
199 dev_info(ec->dev, in ntxec_probe()
202 if (of_device_is_system_power_controller(ec->dev->of_node)) { in ntxec_probe()
207 res = regmap_write(ec->regmap, NTXEC_REG_POWERKEEP, in ntxec_probe()
217 dev_err(ec->dev, "poweroff_restart_client already assigned\n"); in ntxec_probe()
223 dev_err(ec->dev, "pm_power_off already assigned\n"); in ntxec_probe()
229 dev_err(ec->dev, in ntxec_probe()
233 i2c_set_clientdata(client, ec); in ntxec_probe()
235 res = devm_mfd_add_devices(ec->dev, PLATFORM_DEVID_NONE, in ntxec_probe()
238 dev_err(ec->dev, "Failed to add subdevices: %d\n", res); in ntxec_probe()
269 MODULE_DESCRIPTION("Core driver for Netronix EC");