Lines Matching full:lochnagar

3  * Lochnagar I2C bus interface
23 #include <linux/mfd/lochnagar.h>
227 * @lochnagar: A pointer to the primary core data structure.
231 int lochnagar_update_config(struct lochnagar *lochnagar) in lochnagar_update_config() argument
233 struct regmap *regmap = lochnagar->regmap; in lochnagar_update_config()
239 lockdep_assert_held(&lochnagar->analogue_config_lock); in lochnagar_update_config()
241 if (lochnagar->type != LOCHNAGAR2) in lochnagar_update_config()
273 struct lochnagar *lochnagar; in lochnagar_i2c_probe() local
280 lochnagar = devm_kzalloc(dev, sizeof(*lochnagar), GFP_KERNEL); in lochnagar_i2c_probe()
281 if (!lochnagar) in lochnagar_i2c_probe()
286 lochnagar->dev = dev; in lochnagar_i2c_probe()
287 mutex_init(&lochnagar->analogue_config_lock); in lochnagar_i2c_probe()
289 dev_set_drvdata(dev, lochnagar); in lochnagar_i2c_probe()
305 /* Leave the Lochnagar in reset for a reasonable amount of time */ in lochnagar_i2c_probe()
308 /* Bring Lochnagar out of reset */ in lochnagar_i2c_probe()
311 /* Identify Lochnagar */ in lochnagar_i2c_probe()
312 lochnagar->type = config->type; in lochnagar_i2c_probe()
314 lochnagar->regmap = devm_regmap_init_i2c(i2c, config->regmap); in lochnagar_i2c_probe()
315 if (IS_ERR(lochnagar->regmap)) { in lochnagar_i2c_probe()
316 ret = PTR_ERR(lochnagar->regmap); in lochnagar_i2c_probe()
321 /* Wait for Lochnagar to boot */ in lochnagar_i2c_probe()
322 ret = lochnagar_wait_for_boot(lochnagar->regmap, &val); in lochnagar_i2c_probe()
339 ret = regmap_read(lochnagar->regmap, LOCHNAGAR_FIRMWARE_ID1, &val); in lochnagar_i2c_probe()
347 ret = regmap_read(lochnagar->regmap, LOCHNAGAR_FIRMWARE_ID2, &val); in lochnagar_i2c_probe()
358 ret = regmap_register_patch(lochnagar->regmap, config->patch, in lochnagar_i2c_probe()
376 .name = "lochnagar",
389 pr_err("Failed to register Lochnagar driver: %d\n", ret); in lochnagar_i2c_init()