tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-regulator head: a86195a2886ae58b7ad7499c8d3efeb9f5329ed4 commit: ceeec59be59fb6f9cd81e7fd11fc8914f62f927c [3/8] regulator: core: Only support passing enable GPIO descriptors config: i386-randconfig-x018-201835 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: git checkout ceeec59be59fb6f9cd81e7fd11fc8914f62f927c # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): drivers/regulator/wm8994-regulator.c: In function 'wm8994_ldo_probe': drivers/regulator/wm8994-regulator.c:149:10: error: 'struct regulator_config' has no member named 'ena_gpio'; did you mean 'ena_gpiod'? config.ena_gpio = pdata->ldo[id].enable; ^~~~~~~~ ena_gpiod drivers/regulator/wm8994-regulator.c:151:10: error: 'struct regulator_config' has no member named 'ena_gpio'; did you mean 'ena_gpiod'? config.ena_gpio = wm8994->pdata.ldo[id].enable; ^~~~~~~~ ena_gpiod drivers/regulator/wm8994-regulator.c:152:10: error: 'struct regulator_config' has no member named 'ena_gpio_initialized'; did you mean 'ena_gpio_invert'? config.ena_gpio_initialized = true; ^~~~~~~~~~~~~~~~~~~~ ena_gpio_invert In file included from include/linux/export.h:45:0, from include/linux/linkage.h:7, from include/linux/kernel.h:7, from include/linux/list.h:9, from include/linux/module.h:9, from drivers/regulator/wm8994-regulator.c:14: drivers/regulator/wm8994-regulator.c:162:15: error: 'struct regulator_config' has no member named 'ena_gpio'; did you mean 'ena_gpiod'? if (!config.ena_gpio) ^ include/linux/compiler.h:58:30: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^~~~ >> drivers/regulator/wm8994-regulator.c:162:3: note: in expansion of macro 'if' if (!config.ena_gpio) ^~ drivers/regulator/wm8994-regulator.c:162:15: error: 'struct regulator_config' has no member named 'ena_gpio'; did you mean 'ena_gpiod'? if (!config.ena_gpio) ^ include/linux/compiler.h:58:42: note: in definition of macro '__trace_if' if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^~~~ >> drivers/regulator/wm8994-regulator.c:162:3: note: in expansion of macro 'if' if (!config.ena_gpio) ^~ drivers/regulator/wm8994-regulator.c:162:15: error: 'struct regulator_config' has no member named 'ena_gpio'; did you mean 'ena_gpiod'? if (!config.ena_gpio) ^ include/linux/compiler.h:69:16: note: in definition of macro '__trace_if' ______r = !!(cond); \ ^~~~ >> drivers/regulator/wm8994-regulator.c:162:3: note: in expansion of macro 'if' if (!config.ena_gpio) ^~ vim +/if +162 drivers/regulator/wm8994-regulator.c 69dc16c32 Mark Brown 2010-01-25 @14 #include <linux/module.h> 69dc16c32 Mark Brown 2010-01-25 15 #include <linux/moduleparam.h> 69dc16c32 Mark Brown 2010-01-25 16 #include <linux/init.h> 69dc16c32 Mark Brown 2010-01-25 17 #include <linux/bitops.h> 69dc16c32 Mark Brown 2010-01-25 18 #include <linux/err.h> 69dc16c32 Mark Brown 2010-01-25 19 #include <linux/platform_device.h> 69dc16c32 Mark Brown 2010-01-25 20 #include <linux/regulator/driver.h> e3d27775f Mark Brown 2013-04-05 21 #include <linux/regulator/machine.h> 69dc16c32 Mark Brown 2010-01-25 22 #include <linux/gpio.h> 5a0e3ad6a Tejun Heo 2010-03-24 23 #include <linux/slab.h> 69dc16c32 Mark Brown 2010-01-25 24 69dc16c32 Mark Brown 2010-01-25 25 #include <linux/mfd/wm8994/core.h> 69dc16c32 Mark Brown 2010-01-25 26 #include <linux/mfd/wm8994/registers.h> 69dc16c32 Mark Brown 2010-01-25 27 #include <linux/mfd/wm8994/pdata.h> 69dc16c32 Mark Brown 2010-01-25 28 69dc16c32 Mark Brown 2010-01-25 29 struct wm8994_ldo { 69dc16c32 Mark Brown 2010-01-25 30 struct regulator_dev *regulator; 69dc16c32 Mark Brown 2010-01-25 31 struct wm8994 *wm8994; e3d27775f Mark Brown 2013-04-05 32 struct regulator_consumer_supply supply; e3d27775f Mark Brown 2013-04-05 33 struct regulator_init_data init_data; 69dc16c32 Mark Brown 2010-01-25 34 }; 69dc16c32 Mark Brown 2010-01-25 35 69dc16c32 Mark Brown 2010-01-25 36 #define WM8994_LDO1_MAX_SELECTOR 0x7 69dc16c32 Mark Brown 2010-01-25 37 #define WM8994_LDO2_MAX_SELECTOR 0x3 69dc16c32 Mark Brown 2010-01-25 38 b0d6dd3ba Julia Lawall 2015-12-19 39 static const struct regulator_ops wm8994_ldo1_ops = { f2d103add Axel Lin 2012-05-23 40 .list_voltage = regulator_list_voltage_linear, f2d103add Axel Lin 2012-05-23 41 .map_voltage = regulator_map_voltage_linear, 633b6fcd5 Mark Brown 2012-04-15 42 .get_voltage_sel = regulator_get_voltage_sel_regmap, 633b6fcd5 Mark Brown 2012-04-15 43 .set_voltage_sel = regulator_set_voltage_sel_regmap, 69dc16c32 Mark Brown 2010-01-25 44 }; 69dc16c32 Mark Brown 2010-01-25 45 69dc16c32 Mark Brown 2010-01-25 46 static int wm8994_ldo2_list_voltage(struct regulator_dev *rdev, 69dc16c32 Mark Brown 2010-01-25 47 unsigned int selector) 69dc16c32 Mark Brown 2010-01-25 48 { 5a7743eda Mark Brown 2010-12-13 49 struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); 5a7743eda Mark Brown 2010-12-13 50 69dc16c32 Mark Brown 2010-01-25 51 if (selector > WM8994_LDO2_MAX_SELECTOR) 69dc16c32 Mark Brown 2010-01-25 52 return -EINVAL; 69dc16c32 Mark Brown 2010-01-25 53 5a7743eda Mark Brown 2010-12-13 54 switch (ldo->wm8994->type) { 5a7743eda Mark Brown 2010-12-13 55 case WM8994: 69dc16c32 Mark Brown 2010-01-25 56 return (selector * 100000) + 900000; 5a7743eda Mark Brown 2010-12-13 57 case WM8958: 5a7743eda Mark Brown 2010-12-13 58 return (selector * 100000) + 1000000; a1ff89ef3 Mark Brown 2011-07-24 59 case WM1811: a1ff89ef3 Mark Brown 2011-07-24 60 switch (selector) { a1ff89ef3 Mark Brown 2011-07-24 61 case 0: a1ff89ef3 Mark Brown 2011-07-24 62 return -EINVAL; a1ff89ef3 Mark Brown 2011-07-24 63 default: a1ff89ef3 Mark Brown 2011-07-24 64 return (selector * 100000) + 950000; a1ff89ef3 Mark Brown 2011-07-24 65 } a1ff89ef3 Mark Brown 2011-07-24 66 break; 5a7743eda Mark Brown 2010-12-13 67 default: 5a7743eda Mark Brown 2010-12-13 68 return -EINVAL; 5a7743eda Mark Brown 2010-12-13 69 } 69dc16c32 Mark Brown 2010-01-25 70 } 69dc16c32 Mark Brown 2010-01-25 71 b0d6dd3ba Julia Lawall 2015-12-19 72 static const struct regulator_ops wm8994_ldo2_ops = { 69dc16c32 Mark Brown 2010-01-25 73 .list_voltage = wm8994_ldo2_list_voltage, 633b6fcd5 Mark Brown 2012-04-15 74 .get_voltage_sel = regulator_get_voltage_sel_regmap, 633b6fcd5 Mark Brown 2012-04-15 75 .set_voltage_sel = regulator_set_voltage_sel_regmap, 69dc16c32 Mark Brown 2010-01-25 76 }; 69dc16c32 Mark Brown 2010-01-25 77 25e4d602f Mark Brown 2012-04-03 78 static const struct regulator_desc wm8994_ldo_desc[] = { 69dc16c32 Mark Brown 2010-01-25 79 { 69dc16c32 Mark Brown 2010-01-25 80 .name = "LDO1", 69dc16c32 Mark Brown 2010-01-25 81 .id = 1, 69dc16c32 Mark Brown 2010-01-25 82 .type = REGULATOR_VOLTAGE, 69dc16c32 Mark Brown 2010-01-25 83 .n_voltages = WM8994_LDO1_MAX_SELECTOR + 1, 633b6fcd5 Mark Brown 2012-04-15 84 .vsel_reg = WM8994_LDO_1, 633b6fcd5 Mark Brown 2012-04-15 85 .vsel_mask = WM8994_LDO1_VSEL_MASK, 69dc16c32 Mark Brown 2010-01-25 86 .ops = &wm8994_ldo1_ops, f2d103add Axel Lin 2012-05-23 87 .min_uV = 2400000, f2d103add Axel Lin 2012-05-23 88 .uV_step = 100000, 00581b30a Mark Brown 2012-06-27 89 .enable_time = 3000, 69dc16c32 Mark Brown 2010-01-25 90 .owner = THIS_MODULE, 69dc16c32 Mark Brown 2010-01-25 91 }, 69dc16c32 Mark Brown 2010-01-25 92 { 69dc16c32 Mark Brown 2010-01-25 93 .name = "LDO2", 69dc16c32 Mark Brown 2010-01-25 94 .id = 2, 69dc16c32 Mark Brown 2010-01-25 95 .type = REGULATOR_VOLTAGE, 69dc16c32 Mark Brown 2010-01-25 96 .n_voltages = WM8994_LDO2_MAX_SELECTOR + 1, 633b6fcd5 Mark Brown 2012-04-15 97 .vsel_reg = WM8994_LDO_2, 633b6fcd5 Mark Brown 2012-04-15 98 .vsel_mask = WM8994_LDO2_VSEL_MASK, 69dc16c32 Mark Brown 2010-01-25 99 .ops = &wm8994_ldo2_ops, 00581b30a Mark Brown 2012-06-27 100 .enable_time = 3000, 69dc16c32 Mark Brown 2010-01-25 101 .owner = THIS_MODULE, 69dc16c32 Mark Brown 2010-01-25 102 }, 69dc16c32 Mark Brown 2010-01-25 103 }; 69dc16c32 Mark Brown 2010-01-25 104 e3d27775f Mark Brown 2013-04-05 105 static const struct regulator_consumer_supply wm8994_ldo_consumer[] = { e3d27775f Mark Brown 2013-04-05 106 { .supply = "AVDD1" }, e3d27775f Mark Brown 2013-04-05 107 { .supply = "DCVDD" }, e3d27775f Mark Brown 2013-04-05 108 }; e3d27775f Mark Brown 2013-04-05 109 e3d27775f Mark Brown 2013-04-05 110 static const struct regulator_init_data wm8994_ldo_default[] = { e3d27775f Mark Brown 2013-04-05 111 { e3d27775f Mark Brown 2013-04-05 112 .constraints = { e3d27775f Mark Brown 2013-04-05 113 .valid_ops_mask = REGULATOR_CHANGE_STATUS, e3d27775f Mark Brown 2013-04-05 114 }, e3d27775f Mark Brown 2013-04-05 115 .num_consumer_supplies = 1, e3d27775f Mark Brown 2013-04-05 116 }, e3d27775f Mark Brown 2013-04-05 117 { e3d27775f Mark Brown 2013-04-05 118 .constraints = { e3d27775f Mark Brown 2013-04-05 119 .valid_ops_mask = REGULATOR_CHANGE_STATUS, e3d27775f Mark Brown 2013-04-05 120 }, e3d27775f Mark Brown 2013-04-05 121 .num_consumer_supplies = 1, e3d27775f Mark Brown 2013-04-05 122 }, e3d27775f Mark Brown 2013-04-05 123 }; e3d27775f Mark Brown 2013-04-05 124 a5023574d Bill Pemberton 2012-11-19 125 static int wm8994_ldo_probe(struct platform_device *pdev) 69dc16c32 Mark Brown 2010-01-25 126 { 69dc16c32 Mark Brown 2010-01-25 127 struct wm8994 *wm8994 = dev_get_drvdata(pdev->dev.parent); dff91d0b7 Jingoo Han 2013-07-30 128 struct wm8994_pdata *pdata = dev_get_platdata(wm8994->dev); 69dc16c32 Mark Brown 2010-01-25 129 int id = pdev->id % ARRAY_SIZE(pdata->ldo); c172708d3 Mark Brown 2012-04-04 130 struct regulator_config config = { }; 69dc16c32 Mark Brown 2010-01-25 131 struct wm8994_ldo *ldo; 69dc16c32 Mark Brown 2010-01-25 132 int ret; 69dc16c32 Mark Brown 2010-01-25 133 69dc16c32 Mark Brown 2010-01-25 134 dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1); 69dc16c32 Mark Brown 2010-01-25 135 b9e0348f2 Mark Brown 2012-02-15 136 ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm8994_ldo), GFP_KERNEL); 4deaf85a3 Sachin Kamat 2014-02-20 137 if (!ldo) 69dc16c32 Mark Brown 2010-01-25 138 return -ENOMEM; 69dc16c32 Mark Brown 2010-01-25 139 69dc16c32 Mark Brown 2010-01-25 140 ldo->wm8994 = wm8994; e3d27775f Mark Brown 2013-04-05 141 ldo->supply = wm8994_ldo_consumer[id]; e3d27775f Mark Brown 2013-04-05 142 ldo->supply.dev_name = dev_name(wm8994->dev); 69dc16c32 Mark Brown 2010-01-25 143 5d0526ead Mark Brown 2012-05-08 144 config.dev = wm8994->dev; c172708d3 Mark Brown 2012-04-04 145 config.driver_data = ldo; 633b6fcd5 Mark Brown 2012-04-15 146 config.regmap = wm8994->regmap; e3d27775f Mark Brown 2013-04-05 147 config.init_data = &ldo->init_data; 1de3821ac Markus Pargmann 2014-11-03 148 if (pdata) { 495fd8c8f Mark Brown 2012-06-27 149 config.ena_gpio = pdata->ldo[id].enable; 1de3821ac Markus Pargmann 2014-11-03 150 } else if (wm8994->dev->of_node) { 3ea938965 Sylwester Nawrocki 2013-04-11 151 config.ena_gpio = wm8994->pdata.ldo[id].enable; 1de3821ac Markus Pargmann 2014-11-03 152 config.ena_gpio_initialized = true; 1de3821ac Markus Pargmann 2014-11-03 153 } e3d27775f Mark Brown 2013-04-05 154 e3d27775f Mark Brown 2013-04-05 155 /* Use default constraints if none set up */ 3ea938965 Sylwester Nawrocki 2013-04-11 156 if (!pdata || !pdata->ldo[id].init_data || wm8994->dev->of_node) { e3d27775f Mark Brown 2013-04-05 157 dev_dbg(wm8994->dev, "Using default init data, supply %s %s\n", e3d27775f Mark Brown 2013-04-05 158 ldo->supply.dev_name, ldo->supply.supply); e3d27775f Mark Brown 2013-04-05 159 e3d27775f Mark Brown 2013-04-05 160 ldo->init_data = wm8994_ldo_default[id]; e3d27775f Mark Brown 2013-04-05 161 ldo->init_data.consumer_supplies = &ldo->supply; e3d27775f Mark Brown 2013-04-05 @162 if (!config.ena_gpio) e3d27775f Mark Brown 2013-04-05 163 ldo->init_data.constraints.valid_ops_mask = 0; e3d27775f Mark Brown 2013-04-05 164 } else { e3d27775f Mark Brown 2013-04-05 165 ldo->init_data = *pdata->ldo[id].init_data; 495fd8c8f Mark Brown 2012-06-27 166 } c172708d3 Mark Brown 2012-04-04 167 9e2bfbbdf Mark Brown 2013-08-31 168 ldo->regulator = devm_regulator_register(&pdev->dev, 9e2bfbbdf Mark Brown 2013-08-31 169 &wm8994_ldo_desc[id], 9e2bfbbdf Mark Brown 2013-08-31 170 &config); 69dc16c32 Mark Brown 2010-01-25 171 if (IS_ERR(ldo->regulator)) { 69dc16c32 Mark Brown 2010-01-25 172 ret = PTR_ERR(ldo->regulator); 69dc16c32 Mark Brown 2010-01-25 173 dev_err(wm8994->dev, "Failed to register LDO%d: %d\n", 69dc16c32 Mark Brown 2010-01-25 174 id + 1, ret); 495fd8c8f Mark Brown 2012-06-27 175 goto err; 69dc16c32 Mark Brown 2010-01-25 176 } 69dc16c32 Mark Brown 2010-01-25 177 69dc16c32 Mark Brown 2010-01-25 178 platform_set_drvdata(pdev, ldo); 69dc16c32 Mark Brown 2010-01-25 179 69dc16c32 Mark Brown 2010-01-25 180 return 0; 69dc16c32 Mark Brown 2010-01-25 181 69dc16c32 Mark Brown 2010-01-25 182 err: 69dc16c32 Mark Brown 2010-01-25 183 return ret; 69dc16c32 Mark Brown 2010-01-25 184 } 69dc16c32 Mark Brown 2010-01-25 185 :::::: The code at line 162 was first introduced by commit :::::: e3d27775fcf5e78cca346d298e8e7f4afeefc5c1 regulator: wm8994: Provide default init data :::::: TO: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> :::::: CC: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip