Lines Matching refs:max20411
27 struct max20411 { struct
104 struct max20411 *max20411; in max20411_probe() local
106 max20411 = devm_kzalloc(dev, sizeof(*max20411), GFP_KERNEL); in max20411_probe()
107 if (!max20411) in max20411_probe()
110 max20411->regmap = devm_regmap_init_i2c(client, &max20411_regmap_config); in max20411_probe()
111 if (IS_ERR(max20411->regmap)) { in max20411_probe()
113 return PTR_ERR(max20411->regmap); in max20411_probe()
116 max20411->dev = dev; in max20411_probe()
117 max20411->of_node = dev->of_node; in max20411_probe()
119 max20411->desc = max20411_desc; in max20411_probe()
120 init_data = of_get_regulator_init_data(max20411->dev, max20411->of_node, &max20411->desc); in max20411_probe()
124 cfg.dev = max20411->dev; in max20411_probe()
126 cfg.of_node = max20411->of_node; in max20411_probe()
127 cfg.driver_data = max20411; in max20411_probe()
129 cfg.ena_gpiod = gpiod_get(max20411->dev, "enable", GPIOD_ASIS); in max20411_probe()
134 max20411->rdev = devm_regulator_register(max20411->dev, &max20411->desc, &cfg); in max20411_probe()
135 if (IS_ERR(max20411->rdev)) in max20411_probe()
136 dev_err(max20411->dev, "Failed to register regulator\n"); in max20411_probe()
138 return PTR_ERR_OR_ZERO(max20411->rdev); in max20411_probe()