Lines Matching refs:config
139 struct gpio_regulator_config *config; in of_get_gpio_regulator_config() local
144 config = devm_kzalloc(dev, in of_get_gpio_regulator_config()
147 if (!config) in of_get_gpio_regulator_config()
150 config->init_data = of_get_regulator_init_data(dev, np, desc); in of_get_gpio_regulator_config()
151 if (!config->init_data) in of_get_gpio_regulator_config()
154 config->supply_name = config->init_data->constraints.name; in of_get_gpio_regulator_config()
157 config->enable_high = true; in of_get_gpio_regulator_config()
160 config->enabled_at_boot = true; in of_get_gpio_regulator_config()
162 of_property_read_u32(np, "startup-delay-us", &config->startup_delay); in of_get_gpio_regulator_config()
164 config->enable_gpio = of_get_named_gpio(np, "enable-gpio", 0); in of_get_gpio_regulator_config()
165 if (config->enable_gpio < 0 && config->enable_gpio != -ENOENT) in of_get_gpio_regulator_config()
166 return ERR_PTR(config->enable_gpio); in of_get_gpio_regulator_config()
174 config->nr_gpios = ret; in of_get_gpio_regulator_config()
175 config->gpios = devm_kcalloc(dev, in of_get_gpio_regulator_config()
176 config->nr_gpios, sizeof(struct gpio), in of_get_gpio_regulator_config()
178 if (!config->gpios) in of_get_gpio_regulator_config()
186 if (proplen > 0 && proplen != config->nr_gpios) { in of_get_gpio_regulator_config()
191 for (i = 0; i < config->nr_gpios; i++) { in of_get_gpio_regulator_config()
198 config->gpios[i].gpio = gpio; in of_get_gpio_regulator_config()
199 config->gpios[i].label = config->supply_name; in of_get_gpio_regulator_config()
204 config->gpios[i].flags = in of_get_gpio_regulator_config()
217 config->states = devm_kcalloc(dev, in of_get_gpio_regulator_config()
221 if (!config->states) in of_get_gpio_regulator_config()
226 &config->states[i].value); in of_get_gpio_regulator_config()
228 &config->states[i].gpios); in of_get_gpio_regulator_config()
230 config->nr_states = i; in of_get_gpio_regulator_config()
232 config->type = REGULATOR_VOLTAGE; in of_get_gpio_regulator_config()
236 config->type = REGULATOR_VOLTAGE; in of_get_gpio_regulator_config()
238 config->type = REGULATOR_CURRENT; in of_get_gpio_regulator_config()
244 return config; in of_get_gpio_regulator_config()
254 struct gpio_regulator_config *config = dev_get_platdata(&pdev->dev); in gpio_regulator_probe() local
266 config = of_get_gpio_regulator_config(&pdev->dev, np, in gpio_regulator_probe()
268 if (IS_ERR(config)) in gpio_regulator_probe()
269 return PTR_ERR(config); in gpio_regulator_probe()
272 drvdata->desc.name = kstrdup(config->supply_name, GFP_KERNEL); in gpio_regulator_probe()
278 if (config->nr_gpios != 0) { in gpio_regulator_probe()
279 drvdata->gpios = kmemdup(config->gpios, in gpio_regulator_probe()
280 config->nr_gpios * sizeof(struct gpio), in gpio_regulator_probe()
288 drvdata->nr_gpios = config->nr_gpios; in gpio_regulator_probe()
299 drvdata->states = kmemdup(config->states, in gpio_regulator_probe()
300 config->nr_states * in gpio_regulator_probe()
308 drvdata->nr_states = config->nr_states; in gpio_regulator_probe()
311 drvdata->desc.enable_time = config->startup_delay; in gpio_regulator_probe()
314 switch (config->type) { in gpio_regulator_probe()
318 drvdata->desc.n_voltages = config->nr_states; in gpio_regulator_probe()
333 if (config->gpios[ptr].flags & GPIOF_OUT_INIT_HIGH) in gpio_regulator_probe()
339 cfg.init_data = config->init_data; in gpio_regulator_probe()
343 if (gpio_is_valid(config->enable_gpio)) { in gpio_regulator_probe()
344 cfg.ena_gpio = config->enable_gpio; in gpio_regulator_probe()
347 cfg.ena_gpio_invert = !config->enable_high; in gpio_regulator_probe()
348 if (config->enabled_at_boot) { in gpio_regulator_probe()
349 if (config->enable_high) in gpio_regulator_probe()
354 if (config->enable_high) in gpio_regulator_probe()