Merge remote-tracking branches 'regulator/topic/88pg86x', 'regulator/topic/dt', 'regulator/topic/formatting' and 'regulator/topic/gpio' into regulator-next
···2233Required properties:44- compatible: Must be "regulator-fixed";55+- regulator-name: Defined in regulator.txt as optional, but required here.5667Optional properties:78- gpio: gpio to use for enable control
···2233Required properties:44- compatible : Must be "regulator-gpio".55+- regulator-name : Defined in regulator.txt as optional, but required66+ here.57- states : Selection of available voltages and GPIO configs.68 if there are no states, then use a fixed regulator79
···54545555 If unsure, say no.56565757+config REGULATOR_88PG86X5858+ tristate "Marvell 88PG86X voltage regulators"5959+ depends on I2C6060+ select REGMAP_I2C6161+ help6262+ This driver supports Marvell 88PG867 and 88PG868 voltage regulators.6363+ They provide two I2C-controlled DC/DC step-down converters with6464+ sleep mode and separate enable pins.6565+5766config REGULATOR_88PM8005867 tristate "Marvell 88PM800 Power regulators"5968 depends on MFD_88PM800
···196196 break;197197 }198198 config->gpios[i].gpio = gpio;199199+ config->gpios[i].label = config->supply_name;199200 if (proplen > 0) {200201 of_property_read_u32_index(np, "gpios-states",201202 i, &ret);···272271 drvdata->desc.name = kstrdup(config->supply_name, GFP_KERNEL);273272 if (drvdata->desc.name == NULL) {274273 dev_err(&pdev->dev, "Failed to allocate supply name\n");275275- ret = -ENOMEM;276276- goto err;274274+ return -ENOMEM;277275 }278276279277 if (config->nr_gpios != 0) {···292292 dev_err(&pdev->dev,293293 "Could not obtain regulator setting GPIOs: %d\n",294294 ret);295295- goto err_memstate;295295+ goto err_memgpio;296296 }297297 }298298···303303 if (drvdata->states == NULL) {304304 dev_err(&pdev->dev, "Failed to allocate state data\n");305305 ret = -ENOMEM;306306- goto err_memgpio;306306+ goto err_stategpio;307307 }308308 drvdata->nr_states = config->nr_states;309309···324324 default:325325 dev_err(&pdev->dev, "No regulator type set\n");326326 ret = -EINVAL;327327- goto err_memgpio;327327+ goto err_memstate;328328 }329329330330 /* build initial state from gpio init data. */···361361 if (IS_ERR(drvdata->dev)) {362362 ret = PTR_ERR(drvdata->dev);363363 dev_err(&pdev->dev, "Failed to register regulator: %d\n", ret);364364- goto err_stategpio;364364+ goto err_memstate;365365 }366366367367 platform_set_drvdata(pdev, drvdata);368368369369 return 0;370370371371-err_stategpio:372372- gpio_free_array(drvdata->gpios, drvdata->nr_gpios);373371err_memstate:374372 kfree(drvdata->states);373373+err_stategpio:374374+ gpio_free_array(drvdata->gpios, drvdata->nr_gpios);375375err_memgpio:376376 kfree(drvdata->gpios);377377err_name:378378 kfree(drvdata->desc.name);379379-err:380379 return ret;381380}382381
+3-2
include/linux/mfd/da9055/pdata.h
···1212#define DA9055_MAX_REGULATORS 813131414struct da9055;1515+struct gpio_desc;15161617enum gpio_select {1718 NO_GPIO = 0,···4847 * controls the regulator set A/B, 0 if not available.4948 */5049 enum gpio_select *reg_rsel;5151- /* GPIOs to enable regulator, 0 if not available */5252- int *ena_gpio;5050+ /* GPIO descriptors to enable regulator, NULL if not available */5151+ struct gpio_desc **ena_gpiods;5352};5453#endif /* __DA9055_PDATA_H */
···1919#include <linux/notifier.h>2020#include <linux/regulator/consumer.h>21212222+struct gpio_desc;2223struct regmap;2324struct regulator_dev;2425struct regulator_config;···388387 * initialized, meaning that >= 0 is a valid gpio389388 * identifier and < 0 is a non existent gpio.390389 * @ena_gpio: GPIO controlling regulator enable.390390+ * @ena_gpiod: GPIO descriptor controlling regulator enable.391391 * @ena_gpio_invert: Sense for GPIO enable control.392392 * @ena_gpio_flags: Flags to use when calling gpio_request_one()393393 */···401399402400 bool ena_gpio_initialized;403401 int ena_gpio;402402+ struct gpio_desc *ena_gpiod;404403 unsigned int ena_gpio_invert:1;405404 unsigned int ena_gpio_flags;406405};