diff mbox series

[rft,v2,1/1] gpio: Drop unused inclusions from of_gpio.h

Message ID 20241031105314.2463446-1-andriy.shevchenko@linux.intel.com
State Changes Requested
Headers show
Series [rft,v2,1/1] gpio: Drop unused inclusions from of_gpio.h | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied fail build log

Commit Message

Andy Shevchenko Oct. 31, 2024, 10:52 a.m. UTC
As a preliminary step, drop unused inclusions from of_gpio.h,
so people will use the header only when it's really needed and
not as a substitute of any of the dropped ones.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---

For testing purposes on what will fail in CIs. People are also
encouraged to test this, if have time / chance / wish.

Nothing special in v2, just to see the currect status of affairs as tons
of the misuse of of_gpio.h has been fixed already.

 include/linux/of_gpio.h | 5 -----
 1 file changed, 5 deletions(-)

Comments

kernel test robot Oct. 31, 2024, 6:40 p.m. UTC | #1
Hi Andy,

kernel test robot noticed the following build errors:

[auto build test ERROR on brgl/gpio/for-next]
[also build test ERROR on linus/master v6.12-rc5 next-20241031]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/gpio-Drop-unused-inclusions-from-of_gpio-h/20241031-185405
base:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link:    https://lore.kernel.org/r/20241031105314.2463446-1-andriy.shevchenko%40linux.intel.com
patch subject: [rft, PATCH v2 1/1] gpio: Drop unused inclusions from of_gpio.h
config: i386-buildonly-randconfig-002-20241031 (https://download.01.org/0day-ci/archive/20241101/202411010235.zmCLneNF-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241101/202411010235.zmCLneNF-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411010235.zmCLneNF-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from sound/soc/codecs/cs42l52.c:18:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> sound/soc/codecs/cs42l52.c:1143:9: error: call to undeclared function 'devm_gpio_request_one'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1143 |                 ret = devm_gpio_request_one(&i2c_client->dev,
         |                       ^
>> sound/soc/codecs/cs42l52.c:1145:10: error: use of undeclared identifier 'GPIOF_OUT_INIT_HIGH'
    1145 |                                             GPIOF_OUT_INIT_HIGH,
         |                                             ^
>> sound/soc/codecs/cs42l52.c:1152:3: error: call to undeclared function 'gpio_set_value_cansleep'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1152 |                 gpio_set_value_cansleep(cs42l52->pdata.reset_gpio, 0);
         |                 ^
   1 warning and 3 errors generated.
--
   In file included from sound/soc/codecs/wcd938x.c:17:
   In file included from include/sound/pcm.h:15:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> sound/soc/codecs/wcd938x.c:3305:2: error: call to undeclared function 'gpio_direction_output'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    3305 |         gpio_direction_output(wcd938x->reset_gpio, 0);
         |         ^
   sound/soc/codecs/wcd938x.c:3305:2: note: did you mean 'gpiod_direction_output'?
   include/linux/gpio/consumer.h:111:5: note: 'gpiod_direction_output' declared here
     111 | int gpiod_direction_output(struct gpio_desc *desc, int value);
         |     ^
>> sound/soc/codecs/wcd938x.c:3308:2: error: call to undeclared function 'gpio_set_value'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    3308 |         gpio_set_value(wcd938x->reset_gpio, 1);
         |         ^
   sound/soc/codecs/wcd938x.c:3308:2: note: did you mean 'gpiod_set_value'?
   include/linux/gpio/consumer.h:122:6: note: 'gpiod_set_value' declared here
     122 | void gpiod_set_value(struct gpio_desc *desc, int value);
         |      ^
   1 warning and 2 errors generated.
--
   In file included from sound/soc/codecs/cs42l73.c:18:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> sound/soc/codecs/cs42l73.c:1316:9: error: call to undeclared function 'devm_gpio_request_one'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1316 |                 ret = devm_gpio_request_one(&i2c_client->dev,
         |                       ^
>> sound/soc/codecs/cs42l73.c:1318:10: error: use of undeclared identifier 'GPIOF_OUT_INIT_HIGH'
    1318 |                                             GPIOF_OUT_INIT_HIGH,
         |                                             ^
>> sound/soc/codecs/cs42l73.c:1325:3: error: call to undeclared function 'gpio_set_value_cansleep'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1325 |                 gpio_set_value_cansleep(cs42l73->pdata.reset_gpio, 0);
         |                 ^
   sound/soc/codecs/cs42l73.c:1363:2: error: call to undeclared function 'gpio_set_value_cansleep'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1363 |         gpio_set_value_cansleep(cs42l73->pdata.reset_gpio, 0);
         |         ^
   1 warning and 4 errors generated.


vim +/devm_gpio_request_one +1143 sound/soc/codecs/cs42l52.c

dfe0f98b8d2e11 Brian Austin      2012-04-27  1089  
4a4043456cb82d Stephen Kitt      2022-03-25  1090  static int cs42l52_i2c_probe(struct i2c_client *i2c_client)
dfe0f98b8d2e11 Brian Austin      2012-04-27  1091  {
dfe0f98b8d2e11 Brian Austin      2012-04-27  1092  	struct cs42l52_private *cs42l52;
6dd17757927ba9 Brian Austin      2013-10-25  1093  	struct cs42l52_platform_data *pdata = dev_get_platdata(&i2c_client->dev);
dfe0f98b8d2e11 Brian Austin      2012-04-27  1094  	int ret;
4ac9b48adf4d56 Charles Keepax    2021-05-11  1095  	unsigned int devid;
dfe0f98b8d2e11 Brian Austin      2012-04-27  1096  	unsigned int reg;
391fc59db87615 Brian Austin      2013-11-15  1097  	u32 val32;
dfe0f98b8d2e11 Brian Austin      2012-04-27  1098  
cd9e0b8282653d Markus Elfring    2017-11-22  1099  	cs42l52 = devm_kzalloc(&i2c_client->dev, sizeof(*cs42l52), GFP_KERNEL);
dfe0f98b8d2e11 Brian Austin      2012-04-27  1100  	if (cs42l52 == NULL)
dfe0f98b8d2e11 Brian Austin      2012-04-27  1101  		return -ENOMEM;
dfe0f98b8d2e11 Brian Austin      2012-04-27  1102  	cs42l52->dev = &i2c_client->dev;
dfe0f98b8d2e11 Brian Austin      2012-04-27  1103  
134b2f576b9144 Brian Austin      2012-06-04  1104  	cs42l52->regmap = devm_regmap_init_i2c(i2c_client, &cs42l52_regmap);
dfe0f98b8d2e11 Brian Austin      2012-04-27  1105  	if (IS_ERR(cs42l52->regmap)) {
dfe0f98b8d2e11 Brian Austin      2012-04-27  1106  		ret = PTR_ERR(cs42l52->regmap);
dfe0f98b8d2e11 Brian Austin      2012-04-27  1107  		dev_err(&i2c_client->dev, "regmap_init() failed: %d\n", ret);
134b2f576b9144 Brian Austin      2012-06-04  1108  		return ret;
dfe0f98b8d2e11 Brian Austin      2012-04-27  1109  	}
391fc59db87615 Brian Austin      2013-11-15  1110  	if (pdata) {
6dd17757927ba9 Brian Austin      2013-10-25  1111  		cs42l52->pdata = *pdata;
391fc59db87615 Brian Austin      2013-11-15  1112  	} else {
cd9e0b8282653d Markus Elfring    2017-11-22  1113  		pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata),
391fc59db87615 Brian Austin      2013-11-15  1114  				     GFP_KERNEL);
e04db58c125230 Markus Elfring    2017-11-22  1115  		if (!pdata)
391fc59db87615 Brian Austin      2013-11-15  1116  			return -ENOMEM;
e04db58c125230 Markus Elfring    2017-11-22  1117  
391fc59db87615 Brian Austin      2013-11-15  1118  		if (i2c_client->dev.of_node) {
391fc59db87615 Brian Austin      2013-11-15  1119  			if (of_property_read_bool(i2c_client->dev.of_node,
391fc59db87615 Brian Austin      2013-11-15  1120  				"cirrus,mica-differential-cfg"))
391fc59db87615 Brian Austin      2013-11-15  1121  				pdata->mica_diff_cfg = true;
391fc59db87615 Brian Austin      2013-11-15  1122  
391fc59db87615 Brian Austin      2013-11-15  1123  			if (of_property_read_bool(i2c_client->dev.of_node,
391fc59db87615 Brian Austin      2013-11-15  1124  				"cirrus,micb-differential-cfg"))
391fc59db87615 Brian Austin      2013-11-15  1125  				pdata->micb_diff_cfg = true;
391fc59db87615 Brian Austin      2013-11-15  1126  
391fc59db87615 Brian Austin      2013-11-15  1127  			if (of_property_read_u32(i2c_client->dev.of_node,
391fc59db87615 Brian Austin      2013-11-15  1128  				"cirrus,micbias-lvl", &val32) >= 0)
391fc59db87615 Brian Austin      2013-11-15  1129  				pdata->micbias_lvl = val32;
391fc59db87615 Brian Austin      2013-11-15  1130  
391fc59db87615 Brian Austin      2013-11-15  1131  			if (of_property_read_u32(i2c_client->dev.of_node,
391fc59db87615 Brian Austin      2013-11-15  1132  				"cirrus,chgfreq-divisor", &val32) >= 0)
69ae8489076fa0 Mark Brown        2013-11-29  1133  				pdata->chgfreq = val32;
391fc59db87615 Brian Austin      2013-11-15  1134  
391fc59db87615 Brian Austin      2013-11-15  1135  			pdata->reset_gpio =
391fc59db87615 Brian Austin      2013-11-15  1136  				of_get_named_gpio(i2c_client->dev.of_node,
391fc59db87615 Brian Austin      2013-11-15  1137  						"cirrus,reset-gpio", 0);
391fc59db87615 Brian Austin      2013-11-15  1138  		}
391fc59db87615 Brian Austin      2013-11-15  1139  		cs42l52->pdata = *pdata;
391fc59db87615 Brian Austin      2013-11-15  1140  	}
dfe0f98b8d2e11 Brian Austin      2012-04-27  1141  
6dd17757927ba9 Brian Austin      2013-10-25  1142  	if (cs42l52->pdata.reset_gpio) {
4e17d2d33abe4b Axel Lin          2014-04-08 @1143  		ret = devm_gpio_request_one(&i2c_client->dev,
4e17d2d33abe4b Axel Lin          2014-04-08  1144  					    cs42l52->pdata.reset_gpio,
4e17d2d33abe4b Axel Lin          2014-04-08 @1145  					    GPIOF_OUT_INIT_HIGH,
4e17d2d33abe4b Axel Lin          2014-04-08  1146  					    "CS42L52 /RST");
6dd17757927ba9 Brian Austin      2013-10-25  1147  		if (ret < 0) {
6dd17757927ba9 Brian Austin      2013-10-25  1148  			dev_err(&i2c_client->dev, "Failed to request /RST %d: %d\n",
6dd17757927ba9 Brian Austin      2013-10-25  1149  				cs42l52->pdata.reset_gpio, ret);
6dd17757927ba9 Brian Austin      2013-10-25  1150  			return ret;
6dd17757927ba9 Brian Austin      2013-10-25  1151  		}
6dd17757927ba9 Brian Austin      2013-10-25 @1152  		gpio_set_value_cansleep(cs42l52->pdata.reset_gpio, 0);
6dd17757927ba9 Brian Austin      2013-10-25  1153  		gpio_set_value_cansleep(cs42l52->pdata.reset_gpio, 1);
6dd17757927ba9 Brian Austin      2013-10-25  1154  	}
6dd17757927ba9 Brian Austin      2013-10-25  1155  
6dd17757927ba9 Brian Austin      2013-10-25  1156  	i2c_set_clientdata(i2c_client, cs42l52);
dfe0f98b8d2e11 Brian Austin      2012-04-27  1157  
dfe0f98b8d2e11 Brian Austin      2012-04-27  1158  	ret = regmap_register_patch(cs42l52->regmap, cs42l52_threshold_patch,
dfe0f98b8d2e11 Brian Austin      2012-04-27  1159  				    ARRAY_SIZE(cs42l52_threshold_patch));
dfe0f98b8d2e11 Brian Austin      2012-04-27  1160  	if (ret != 0)
dfe0f98b8d2e11 Brian Austin      2012-04-27  1161  		dev_warn(cs42l52->dev, "Failed to apply regmap patch: %d\n",
dfe0f98b8d2e11 Brian Austin      2012-04-27  1162  			 ret);
dfe0f98b8d2e11 Brian Austin      2012-04-27  1163  
dfe0f98b8d2e11 Brian Austin      2012-04-27  1164  	ret = regmap_read(cs42l52->regmap, CS42L52_CHIP, &reg);
4ac9b48adf4d56 Charles Keepax    2021-05-11  1165  	if (ret) {
4ac9b48adf4d56 Charles Keepax    2021-05-11  1166  		dev_err(&i2c_client->dev, "Failed to read chip ID: %d\n", ret);
4ac9b48adf4d56 Charles Keepax    2021-05-11  1167  		return ret;
4ac9b48adf4d56 Charles Keepax    2021-05-11  1168  	}
4ac9b48adf4d56 Charles Keepax    2021-05-11  1169  
dfe0f98b8d2e11 Brian Austin      2012-04-27  1170  	devid = reg & CS42L52_CHIP_ID_MASK;
dfe0f98b8d2e11 Brian Austin      2012-04-27  1171  	if (devid != CS42L52_CHIP_ID) {
dfe0f98b8d2e11 Brian Austin      2012-04-27  1172  		ret = -ENODEV;
dfe0f98b8d2e11 Brian Austin      2012-04-27  1173  		dev_err(&i2c_client->dev,
dfe0f98b8d2e11 Brian Austin      2012-04-27  1174  			"CS42L52 Device ID (%X). Expected %X\n",
dfe0f98b8d2e11 Brian Austin      2012-04-27  1175  			devid, CS42L52_CHIP_ID);
134b2f576b9144 Brian Austin      2012-06-04  1176  		return ret;
dfe0f98b8d2e11 Brian Austin      2012-04-27  1177  	}
dfe0f98b8d2e11 Brian Austin      2012-04-27  1178  
e5f03af644c46b Brian Austin      2013-10-25  1179  	dev_info(&i2c_client->dev, "Cirrus Logic CS42L52, Revision: %02X\n",
a14bf88749c5b5 Axel Lin          2014-04-06  1180  		 reg & CS42L52_CHIP_REV_MASK);
e5f03af644c46b Brian Austin      2013-10-25  1181  
153723f6f1d13e Brian Austin      2013-10-25  1182  	/* Set Platform Data */
44b2ed54036ece Brian Austin      2013-11-14  1183  	if (cs42l52->pdata.mica_diff_cfg)
153723f6f1d13e Brian Austin      2013-10-25  1184  		regmap_update_bits(cs42l52->regmap, CS42L52_MICA_CTL,
153723f6f1d13e Brian Austin      2013-10-25  1185  				   CS42L52_MIC_CTL_TYPE_MASK,
44b2ed54036ece Brian Austin      2013-11-14  1186  				cs42l52->pdata.mica_diff_cfg <<
153723f6f1d13e Brian Austin      2013-10-25  1187  				CS42L52_MIC_CTL_TYPE_SHIFT);
153723f6f1d13e Brian Austin      2013-10-25  1188  
44b2ed54036ece Brian Austin      2013-11-14  1189  	if (cs42l52->pdata.micb_diff_cfg)
153723f6f1d13e Brian Austin      2013-10-25  1190  		regmap_update_bits(cs42l52->regmap, CS42L52_MICB_CTL,
153723f6f1d13e Brian Austin      2013-10-25  1191  				   CS42L52_MIC_CTL_TYPE_MASK,
44b2ed54036ece Brian Austin      2013-11-14  1192  				cs42l52->pdata.micb_diff_cfg <<
153723f6f1d13e Brian Austin      2013-10-25  1193  				CS42L52_MIC_CTL_TYPE_SHIFT);
153723f6f1d13e Brian Austin      2013-10-25  1194  
153723f6f1d13e Brian Austin      2013-10-25  1195  	if (cs42l52->pdata.chgfreq)
153723f6f1d13e Brian Austin      2013-10-25  1196  		regmap_update_bits(cs42l52->regmap, CS42L52_CHARGE_PUMP,
153723f6f1d13e Brian Austin      2013-10-25  1197  				   CS42L52_CHARGE_PUMP_MASK,
153723f6f1d13e Brian Austin      2013-10-25  1198  				cs42l52->pdata.chgfreq <<
153723f6f1d13e Brian Austin      2013-10-25  1199  				CS42L52_CHARGE_PUMP_SHIFT);
153723f6f1d13e Brian Austin      2013-10-25  1200  
153723f6f1d13e Brian Austin      2013-10-25  1201  	if (cs42l52->pdata.micbias_lvl)
153723f6f1d13e Brian Austin      2013-10-25  1202  		regmap_update_bits(cs42l52->regmap, CS42L52_IFACE_CTL2,
153723f6f1d13e Brian Austin      2013-10-25  1203  				   CS42L52_IFACE_CTL2_BIAS_LVL,
153723f6f1d13e Brian Austin      2013-10-25  1204  				cs42l52->pdata.micbias_lvl);
dfe0f98b8d2e11 Brian Austin      2012-04-27  1205  
4ac9b48adf4d56 Charles Keepax    2021-05-11  1206  	return devm_snd_soc_register_component(&i2c_client->dev,
9665a74944b321 Kuninori Morimoto 2018-01-29  1207  			&soc_component_dev_cs42l52, &cs42l52_dai, 1);
dfe0f98b8d2e11 Brian Austin      2012-04-27  1208  }
dfe0f98b8d2e11 Brian Austin      2012-04-27  1209
kernel test robot Oct. 31, 2024, 7:54 p.m. UTC | #2
Hi Andy,

kernel test robot noticed the following build errors:

[auto build test ERROR on brgl/gpio/for-next]
[also build test ERROR on linus/master v6.12-rc5 next-20241031]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/gpio-Drop-unused-inclusions-from-of_gpio-h/20241031-185405
base:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link:    https://lore.kernel.org/r/20241031105314.2463446-1-andriy.shevchenko%40linux.intel.com
patch subject: [rft, PATCH v2 1/1] gpio: Drop unused inclusions from of_gpio.h
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20241101/202411010321.X33tMIyP-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241101/202411010321.X33tMIyP-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411010321.X33tMIyP-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/regulator/s5m8767.c: In function 's5m8767_set_high':
   drivers/regulator/s5m8767.c:275:9: error: implicit declaration of function 'gpio_set_value'; did you mean 'gpiod_set_value'? [-Werror=implicit-function-declaration]
     275 |         gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1);
         |         ^~~~~~~~~~~~~~
         |         gpiod_set_value
   drivers/regulator/s5m8767.c: In function 's5m8767_pmic_dt_parse_dvs_gpio':
   drivers/regulator/s5m8767.c:494:22: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration]
     494 |                 if (!gpio_is_valid(gpio)) {
         |                      ^~~~~~~~~~~~~
         |                      uuid_is_valid
   drivers/regulator/s5m8767.c: In function 's5m8767_pmic_dt_parse_pdata':
>> drivers/regulator/s5m8767.c:536:16: error: cleanup argument not a function
     536 |         struct device_node *regulators_np __free(device_node) = of_get_child_by_name(pmic_np,
         |                ^~~~~~~~~~~
>> drivers/regulator/s5m8767.c:536:65: error: implicit declaration of function 'of_get_child_by_name' [-Werror=implicit-function-declaration]
     536 |         struct device_node *regulators_np __free(device_node) = of_get_child_by_name(pmic_np,
         |                                                                 ^~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/s5m8767.c:536:65: warning: initialization of 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
>> drivers/regulator/s5m8767.c:544:33: error: implicit declaration of function 'of_get_child_count' [-Werror=implicit-function-declaration]
     544 |         pdata->num_regulators = of_get_child_count(regulators_np);
         |                                 ^~~~~~~~~~~~~~~~~~
>> drivers/regulator/s5m8767.c:560:9: error: implicit declaration of function 'for_each_child_of_node'; did you mean 'for_each_online_node'? [-Werror=implicit-function-declaration]
     560 |         for_each_child_of_node(regulators_np, reg_np) {
         |         ^~~~~~~~~~~~~~~~~~~~~~
         |         for_each_online_node
>> drivers/regulator/s5m8767.c:560:54: error: expected ';' before '{' token
     560 |         for_each_child_of_node(regulators_np, reg_np) {
         |                                                      ^~
         |                                                      ;
>> drivers/regulator/s5m8767.c:659:36: error: implicit declaration of function 'of_property_read_bool' [-Werror=implicit-function-declaration]
     659 |         pdata->buck2_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck2-ramp-enable");
         |                                    ^~~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/s5m8767.c:665:21: error: implicit declaration of function 'of_property_read_u32' [-Werror=implicit-function-declaration]
     665 |                 if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay",
         |                     ^~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/s5m8767.c:528:25: warning: unused variable 'dvs_voltage_nr' [-Wunused-variable]
     528 |         unsigned int i, dvs_voltage_nr = 8, ret;
         |                         ^~~~~~~~~~~~~~
>> drivers/regulator/s5m8767.c:528:22: warning: unused variable 'i' [-Wunused-variable]
     528 |         unsigned int i, dvs_voltage_nr = 8, ret;
         |                      ^
   drivers/regulator/s5m8767.c: In function 's5m8767_pmic_probe':
   drivers/regulator/s5m8767.c:798:23: error: implicit declaration of function 'devm_gpio_request'; did you mean 'devm_gpiod_put'? [-Werror=implicit-function-declaration]
     798 |                 ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[0],
         |                       ^~~~~~~~~~~~~~~~~
         |                       devm_gpiod_put
   drivers/regulator/s5m8767.c:814:17: error: implicit declaration of function 'gpio_direction_output'; did you mean 'gpiod_direction_output'? [-Werror=implicit-function-declaration]
     814 |                 gpio_direction_output(pdata->buck_gpios[0],
         |                 ^~~~~~~~~~~~~~~~~~~~~
         |                 gpiod_direction_output
   drivers/regulator/s5m8767.c: At top level:
   drivers/regulator/s5m8767.c:988:40: error: array type has incomplete element type 'struct platform_device_id'
     988 | static const struct platform_device_id s5m8767_pmic_id[] = {
         |                                        ^~~~~~~~~~~~~~~
   drivers/regulator/s5m8767.c:988:40: warning: 's5m8767_pmic_id' defined but not used [-Wunused-variable]
>> drivers/regulator/s5m8767.c:503:12: warning: 's5m8767_pmic_dt_parse_ds_gpio' defined but not used [-Wunused-function]
     503 | static int s5m8767_pmic_dt_parse_ds_gpio(struct sec_pmic_dev *iodev,
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/s5m8767.c:485:12: warning: 's5m8767_pmic_dt_parse_dvs_gpio' defined but not used [-Wunused-function]
     485 | static int s5m8767_pmic_dt_parse_dvs_gpio(struct sec_pmic_dev *iodev,
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   sound/soc/codecs/cs42l52.c: In function 'cs42l52_i2c_probe':
>> sound/soc/codecs/cs42l52.c:1143:23: error: implicit declaration of function 'devm_gpio_request_one' [-Werror=implicit-function-declaration]
    1143 |                 ret = devm_gpio_request_one(&i2c_client->dev,
         |                       ^~~~~~~~~~~~~~~~~~~~~
>> sound/soc/codecs/cs42l52.c:1145:45: error: 'GPIOF_OUT_INIT_HIGH' undeclared (first use in this function)
    1145 |                                             GPIOF_OUT_INIT_HIGH,
         |                                             ^~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cs42l52.c:1145:45: note: each undeclared identifier is reported only once for each function it appears in
>> sound/soc/codecs/cs42l52.c:1152:17: error: implicit declaration of function 'gpio_set_value_cansleep' [-Werror=implicit-function-declaration]
    1152 |                 gpio_set_value_cansleep(cs42l52->pdata.reset_gpio, 0);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   sound/soc/codecs/cs42l56.c: In function 'cs42l56_i2c_probe':
>> sound/soc/codecs/cs42l56.c:1203:23: error: implicit declaration of function 'gpio_request_one' [-Werror=implicit-function-declaration]
    1203 |                 ret = gpio_request_one(cs42l56->pdata.gpio_nreset,
         |                       ^~~~~~~~~~~~~~~~
>> sound/soc/codecs/cs42l56.c:1204:40: error: 'GPIOF_OUT_INIT_HIGH' undeclared (first use in this function)
    1204 |                                        GPIOF_OUT_INIT_HIGH, "CS42L56 /RST");
         |                                        ^~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cs42l56.c:1204:40: note: each undeclared identifier is reported only once for each function it appears in
>> sound/soc/codecs/cs42l56.c:1211:17: error: implicit declaration of function 'gpio_set_value_cansleep' [-Werror=implicit-function-declaration]
    1211 |                 gpio_set_value_cansleep(cs42l56->pdata.gpio_nreset, 0);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   sound/soc/codecs/wcd9335.c: In function 'wcd9335_power_on_reset':
>> sound/soc/codecs/wcd9335.c:5024:9: error: implicit declaration of function 'gpio_direction_output' [-Werror=implicit-function-declaration]
    5024 |         gpio_direction_output(wcd->reset_gpio, 0);
         |         ^~~~~~~~~~~~~~~~~~~~~
>> sound/soc/codecs/wcd9335.c:5026:9: error: implicit declaration of function 'gpio_set_value' [-Werror=implicit-function-declaration]
    5026 |         gpio_set_value(wcd->reset_gpio, 1);
         |         ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   sound/soc/codecs/wcd938x.c: In function 'wcd938x_reset':
>> sound/soc/codecs/wcd938x.c:3305:9: error: implicit declaration of function 'gpio_direction_output'; did you mean 'gpiod_direction_output'? [-Werror=implicit-function-declaration]
    3305 |         gpio_direction_output(wcd938x->reset_gpio, 0);
         |         ^~~~~~~~~~~~~~~~~~~~~
         |         gpiod_direction_output
>> sound/soc/codecs/wcd938x.c:3308:9: error: implicit declaration of function 'gpio_set_value'; did you mean 'gpiod_set_value'? [-Werror=implicit-function-declaration]
    3308 |         gpio_set_value(wcd938x->reset_gpio, 1);
         |         ^~~~~~~~~~~~~~
         |         gpiod_set_value
   cc1: some warnings being treated as errors
--
   sound/soc/codecs/wcd939x.c: In function 'wcd939x_reset':
>> sound/soc/codecs/wcd939x.c:3293:9: error: implicit declaration of function 'gpio_direction_output'; did you mean 'gpiod_direction_output'? [-Werror=implicit-function-declaration]
    3293 |         gpio_direction_output(wcd939x->reset_gpio, 0);
         |         ^~~~~~~~~~~~~~~~~~~~~
         |         gpiod_direction_output
>> sound/soc/codecs/wcd939x.c:3296:9: error: implicit declaration of function 'gpio_set_value'; did you mean 'gpiod_set_value'? [-Werror=implicit-function-declaration]
    3296 |         gpio_set_value(wcd939x->reset_gpio, 1);
         |         ^~~~~~~~~~~~~~
         |         gpiod_set_value
   cc1: some warnings being treated as errors
--
   drivers/nfc/nfcmrvl/main.c: In function 'nfcmrvl_parse_dt':
>> drivers/nfc/nfcmrvl/main.c:264:28: error: implicit declaration of function 'of_property_read_bool' [-Werror=implicit-function-declaration]
     264 |         pdata->hci_muxed = of_property_read_bool(node, "hci-muxed");
         |                            ^~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   drivers/nfc/nfcmrvl/uart.c: In function 'nfcmrvl_uart_parse_dt':
>> drivers/nfc/nfcmrvl/uart.c:65:24: error: implicit declaration of function 'of_get_compatible_child' [-Werror=implicit-function-declaration]
      65 |         matched_node = of_get_compatible_child(node, "marvell,nfc-uart");
         |                        ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/nfc/nfcmrvl/uart.c:65:22: warning: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      65 |         matched_node = of_get_compatible_child(node, "marvell,nfc-uart");
         |                      ^
   drivers/nfc/nfcmrvl/uart.c:67:30: warning: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      67 |                 matched_node = of_get_compatible_child(node, "mrvl,nfc-uart");
         |                              ^
>> drivers/nfc/nfcmrvl/uart.c:75:17: error: implicit declaration of function 'of_node_put' [-Werror=implicit-function-declaration]
      75 |                 of_node_put(matched_node);
         |                 ^~~~~~~~~~~
>> drivers/nfc/nfcmrvl/uart.c:79:31: error: implicit declaration of function 'of_property_read_bool' [-Werror=implicit-function-declaration]
      79 |         pdata->flow_control = of_property_read_bool(matched_node, "flow-control");
         |                               ^~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +536 drivers/regulator/s5m8767.c

ee1e0994ab1bd3 Krzysztof Kozlowski      2014-01-24  482  
ee1e0994ab1bd3 Krzysztof Kozlowski      2014-01-24  483  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  484  #ifdef CONFIG_OF
26aec009f6b61c Amit Daniel Kachhap      2013-02-03 @485  static int s5m8767_pmic_dt_parse_dvs_gpio(struct sec_pmic_dev *iodev,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  486  			struct sec_platform_data *pdata,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  487  			struct device_node *pmic_np)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  488  {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  489  	int i, gpio;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  490  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  491  	for (i = 0; i < 3; i++) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  492  		gpio = of_get_named_gpio(pmic_np,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  493  					"s5m8767,pmic-buck-dvs-gpios", i);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03 @494  		if (!gpio_is_valid(gpio)) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  495  			dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  496  			return -EINVAL;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  497  		}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  498  		pdata->buck_gpios[i] = gpio;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  499  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  500  	return 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  501  }
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  502  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03 @503  static int s5m8767_pmic_dt_parse_ds_gpio(struct sec_pmic_dev *iodev,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  504  			struct sec_platform_data *pdata,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  505  			struct device_node *pmic_np)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  506  {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  507  	int i, gpio;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  508  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  509  	for (i = 0; i < 3; i++) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  510  		gpio = of_get_named_gpio(pmic_np,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  511  					"s5m8767,pmic-buck-ds-gpios", i);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  512  		if (!gpio_is_valid(gpio)) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  513  			dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  514  			return -EINVAL;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  515  		}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  516  		pdata->buck_ds[i] = gpio;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  517  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  518  	return 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  519  }
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  520  
cbb0ed495ca165 Axel Lin                 2013-02-13  521  static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  522  					struct sec_platform_data *pdata)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  523  {
cbb0ed495ca165 Axel Lin                 2013-02-13  524  	struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
34a3f95941e0df Krzysztof Kozlowski      2024-08-14  525  	struct device_node *pmic_np, *reg_np;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  526  	struct sec_regulator_data *rdata;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  527  	struct sec_opmode_data *rmode;
04f9f068a619cc Chanwoo Choi             2013-10-10 @528  	unsigned int i, dvs_voltage_nr = 8, ret;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  529  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  530  	pmic_np = iodev->dev->of_node;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  531  	if (!pmic_np) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  532  		dev_err(iodev->dev, "could not find pmic sub-node\n");
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  533  		return -ENODEV;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  534  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  535  
34a3f95941e0df Krzysztof Kozlowski      2024-08-14 @536  	struct device_node *regulators_np __free(device_node) = of_get_child_by_name(pmic_np,
34a3f95941e0df Krzysztof Kozlowski      2024-08-14  537  										     "regulators");
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  538  	if (!regulators_np) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  539  		dev_err(iodev->dev, "could not find regulators sub-node\n");
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  540  		return -EINVAL;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  541  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  542  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  543  	/* count the number of regulators to be supported in pmic */
1f91b6f6c747d3 Axel Lin                 2013-02-06 @544  	pdata->num_regulators = of_get_child_count(regulators_np);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  545  
a86854d0c599b3 Kees Cook                2018-06-12  546  	rdata = devm_kcalloc(&pdev->dev,
a86854d0c599b3 Kees Cook                2018-06-12  547  			     pdata->num_regulators, sizeof(*rdata),
a86854d0c599b3 Kees Cook                2018-06-12  548  			     GFP_KERNEL);
34a3f95941e0df Krzysztof Kozlowski      2024-08-14  549  	if (!rdata)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  550  		return -ENOMEM;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  551  
a86854d0c599b3 Kees Cook                2018-06-12  552  	rmode = devm_kcalloc(&pdev->dev,
a86854d0c599b3 Kees Cook                2018-06-12  553  			     pdata->num_regulators, sizeof(*rmode),
a86854d0c599b3 Kees Cook                2018-06-12  554  			     GFP_KERNEL);
34a3f95941e0df Krzysztof Kozlowski      2024-08-14  555  	if (!rmode)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  556  		return -ENOMEM;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  557  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  558  	pdata->regulators = rdata;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  559  	pdata->opmode = rmode;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03 @560  	for_each_child_of_node(regulators_np, reg_np) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  561  		for (i = 0; i < ARRAY_SIZE(regulators); i++)
c32569e358adea Rob Herring              2018-12-05  562  			if (of_node_name_eq(reg_np, regulators[i].name))
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  563  				break;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  564  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  565  		if (i == ARRAY_SIZE(regulators)) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  566  			dev_warn(iodev->dev,
0c9721a5d1dea7 Rob Herring              2018-08-27  567  			"don't know how to configure regulator %pOFn\n",
0c9721a5d1dea7 Rob Herring              2018-08-27  568  			reg_np);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  569  			continue;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  570  		}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  571  
5be0e549e18f8a Dmitry Torokhov          2019-10-04  572  		rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
63239e4bf7eff3 Linus Walleij            2018-10-15  573  			&pdev->dev,
5be0e549e18f8a Dmitry Torokhov          2019-10-04  574  			of_fwnode_handle(reg_np),
5be0e549e18f8a Dmitry Torokhov          2019-10-04  575  			"s5m8767,pmic-ext-control",
63239e4bf7eff3 Linus Walleij            2018-10-15  576  			GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
9ae5cc75ceaacf Linus Walleij            2018-05-14  577  			"s5m8767");
dea6dd2ba63f8c Pan Bian                 2021-01-20  578  		if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT) {
025bf37725f192 Waibel Georg             2019-06-20  579  			rdata->ext_control_gpiod = NULL;
dea6dd2ba63f8c Pan Bian                 2021-01-20  580  		} else if (IS_ERR(rdata->ext_control_gpiod)) {
dea6dd2ba63f8c Pan Bian                 2021-01-20  581  			of_node_put(reg_np);
9ae5cc75ceaacf Linus Walleij            2018-05-14  582  			return PTR_ERR(rdata->ext_control_gpiod);
dea6dd2ba63f8c Pan Bian                 2021-01-20  583  		}
ee1e0994ab1bd3 Krzysztof Kozlowski      2014-01-24  584  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  585  		rdata->id = i;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  586  		rdata->initdata = of_get_regulator_init_data(
072e78b12bf518 Javier Martinez Canillas 2014-11-10  587  						&pdev->dev, reg_np,
072e78b12bf518 Javier Martinez Canillas 2014-11-10  588  						&regulators[i]);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  589  		rdata->reg_node = reg_np;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  590  		rdata++;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  591  		rmode->id = i;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  592  		if (of_property_read_u32(reg_np, "op_mode",
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  593  				&rmode->mode)) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  594  			dev_warn(iodev->dev,
f3c7f7b636ef50 Christophe JAILLET       2019-12-03  595  				"no op_mode property at %pOF\n",
7799167b7a14fe Rob Herring              2017-07-18  596  				reg_np);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  597  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  598  			rmode->mode = S5M8767_OPMODE_NORMAL_MODE;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  599  		}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  600  		rmode++;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  601  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  602  
5bd73a162bc881 Rob Herring              2023-03-10  603  	if (of_property_read_bool(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs")) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  604  		pdata->buck2_gpiodvs = true;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  605  
04f9f068a619cc Chanwoo Choi             2013-10-10  606  		if (of_property_read_u32_array(pmic_np,
04f9f068a619cc Chanwoo Choi             2013-10-10  607  				"s5m8767,pmic-buck2-dvs-voltage",
04f9f068a619cc Chanwoo Choi             2013-10-10  608  				pdata->buck2_voltage, dvs_voltage_nr)) {
04f9f068a619cc Chanwoo Choi             2013-10-10  609  			dev_err(iodev->dev, "buck2 voltages not specified\n");
04f9f068a619cc Chanwoo Choi             2013-10-10  610  			return -EINVAL;
04f9f068a619cc Chanwoo Choi             2013-10-10  611  		}
04f9f068a619cc Chanwoo Choi             2013-10-10  612  	}
04f9f068a619cc Chanwoo Choi             2013-10-10  613  
5bd73a162bc881 Rob Herring              2023-03-10  614  	if (of_property_read_bool(pmic_np, "s5m8767,pmic-buck3-uses-gpio-dvs")) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  615  		pdata->buck3_gpiodvs = true;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  616  
04f9f068a619cc Chanwoo Choi             2013-10-10  617  		if (of_property_read_u32_array(pmic_np,
04f9f068a619cc Chanwoo Choi             2013-10-10  618  				"s5m8767,pmic-buck3-dvs-voltage",
04f9f068a619cc Chanwoo Choi             2013-10-10  619  				pdata->buck3_voltage, dvs_voltage_nr)) {
04f9f068a619cc Chanwoo Choi             2013-10-10  620  			dev_err(iodev->dev, "buck3 voltages not specified\n");
04f9f068a619cc Chanwoo Choi             2013-10-10  621  			return -EINVAL;
04f9f068a619cc Chanwoo Choi             2013-10-10  622  		}
04f9f068a619cc Chanwoo Choi             2013-10-10  623  	}
04f9f068a619cc Chanwoo Choi             2013-10-10  624  
5bd73a162bc881 Rob Herring              2023-03-10  625  	if (of_property_read_bool(pmic_np, "s5m8767,pmic-buck4-uses-gpio-dvs")) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  626  		pdata->buck4_gpiodvs = true;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  627  
04f9f068a619cc Chanwoo Choi             2013-10-10  628  		if (of_property_read_u32_array(pmic_np,
04f9f068a619cc Chanwoo Choi             2013-10-10  629  				"s5m8767,pmic-buck4-dvs-voltage",
04f9f068a619cc Chanwoo Choi             2013-10-10  630  				pdata->buck4_voltage, dvs_voltage_nr)) {
04f9f068a619cc Chanwoo Choi             2013-10-10  631  			dev_err(iodev->dev, "buck4 voltages not specified\n");
04f9f068a619cc Chanwoo Choi             2013-10-10  632  			return -EINVAL;
04f9f068a619cc Chanwoo Choi             2013-10-10  633  		}
04f9f068a619cc Chanwoo Choi             2013-10-10  634  	}
04f9f068a619cc Chanwoo Choi             2013-10-10  635  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  636  	if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  637  						pdata->buck4_gpiodvs) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  638  		ret = s5m8767_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  639  		if (ret)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  640  			return -EINVAL;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  641  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  642  		if (of_property_read_u32(pmic_np,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  643  				"s5m8767,pmic-buck-default-dvs-idx",
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  644  				&pdata->buck_default_idx)) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  645  			pdata->buck_default_idx = 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  646  		} else {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  647  			if (pdata->buck_default_idx >= 8) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  648  				pdata->buck_default_idx = 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  649  				dev_info(iodev->dev,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  650  				"invalid value for default dvs index, use 0\n");
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  651  			}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  652  		}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  653  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  654  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  655  	ret = s5m8767_pmic_dt_parse_ds_gpio(iodev, pdata, pmic_np);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  656  	if (ret)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  657  		return -EINVAL;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  658  
5bd73a162bc881 Rob Herring              2023-03-10 @659  	pdata->buck2_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck2-ramp-enable");
5bd73a162bc881 Rob Herring              2023-03-10  660  	pdata->buck3_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck3-ramp-enable");
5bd73a162bc881 Rob Herring              2023-03-10  661  	pdata->buck4_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck4-ramp-enable");
033054e8603036 Chanwoo Choi             2013-10-10  662  
033054e8603036 Chanwoo Choi             2013-10-10  663  	if (pdata->buck2_ramp_enable || pdata->buck3_ramp_enable
033054e8603036 Chanwoo Choi             2013-10-10  664  			|| pdata->buck4_ramp_enable) {
033054e8603036 Chanwoo Choi             2013-10-10 @665  		if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay",
033054e8603036 Chanwoo Choi             2013-10-10  666  				&pdata->buck_ramp_delay))
033054e8603036 Chanwoo Choi             2013-10-10  667  			pdata->buck_ramp_delay = 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  668  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  669  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  670  	return 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  671  }
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  672  #else
cbb0ed495ca165 Axel Lin                 2013-02-13  673  static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  674  					struct sec_platform_data *pdata)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  675  {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  676  	return 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  677  }
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  678  #endif /* CONFIG_OF */
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  679
kernel test robot Oct. 31, 2024, 7:54 p.m. UTC | #3
Hi Andy,

kernel test robot noticed the following build errors:

[auto build test ERROR on brgl/gpio/for-next]
[also build test ERROR on linus/master v6.12-rc5 next-20241031]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/gpio-Drop-unused-inclusions-from-of_gpio-h/20241031-185405
base:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link:    https://lore.kernel.org/r/20241031105314.2463446-1-andriy.shevchenko%40linux.intel.com
patch subject: [rft, PATCH v2 1/1] gpio: Drop unused inclusions from of_gpio.h
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20241101/202411010328.dd4VPGlr-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241101/202411010328.dd4VPGlr-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411010328.dd4VPGlr-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/regulator/s5m8767.c: In function 's5m8767_set_high':
   drivers/regulator/s5m8767.c:275:9: error: implicit declaration of function 'gpio_set_value'; did you mean 'gpiod_set_value'? [-Wimplicit-function-declaration]
     275 |         gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1);
         |         ^~~~~~~~~~~~~~
         |         gpiod_set_value
   drivers/regulator/s5m8767.c: In function 's5m8767_pmic_dt_parse_dvs_gpio':
   drivers/regulator/s5m8767.c:494:22: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Wimplicit-function-declaration]
     494 |                 if (!gpio_is_valid(gpio)) {
         |                      ^~~~~~~~~~~~~
         |                      uuid_is_valid
   drivers/regulator/s5m8767.c: In function 's5m8767_pmic_dt_parse_pdata':
   drivers/regulator/s5m8767.c:536:16: error: cleanup argument not a function
     536 |         struct device_node *regulators_np __free(device_node) = of_get_child_by_name(pmic_np,
         |                ^~~~~~~~~~~
   drivers/regulator/s5m8767.c:536:65: error: implicit declaration of function 'of_get_child_by_name' [-Wimplicit-function-declaration]
     536 |         struct device_node *regulators_np __free(device_node) = of_get_child_by_name(pmic_np,
         |                                                                 ^~~~~~~~~~~~~~~~~~~~
>> drivers/regulator/s5m8767.c:536:65: error: initialization of 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   drivers/regulator/s5m8767.c:544:33: error: implicit declaration of function 'of_get_child_count' [-Wimplicit-function-declaration]
     544 |         pdata->num_regulators = of_get_child_count(regulators_np);
         |                                 ^~~~~~~~~~~~~~~~~~
   drivers/regulator/s5m8767.c:560:9: error: implicit declaration of function 'for_each_child_of_node'; did you mean 'for_each_online_node'? [-Wimplicit-function-declaration]
     560 |         for_each_child_of_node(regulators_np, reg_np) {
         |         ^~~~~~~~~~~~~~~~~~~~~~
         |         for_each_online_node
   drivers/regulator/s5m8767.c:560:54: error: expected ';' before '{' token
     560 |         for_each_child_of_node(regulators_np, reg_np) {
         |                                                      ^~
         |                                                      ;
   drivers/regulator/s5m8767.c:659:36: error: implicit declaration of function 'of_property_read_bool' [-Wimplicit-function-declaration]
     659 |         pdata->buck2_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck2-ramp-enable");
         |                                    ^~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/s5m8767.c:665:21: error: implicit declaration of function 'of_property_read_u32' [-Wimplicit-function-declaration]
     665 |                 if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay",
         |                     ^~~~~~~~~~~~~~~~~~~~
   drivers/regulator/s5m8767.c:528:25: warning: unused variable 'dvs_voltage_nr' [-Wunused-variable]
     528 |         unsigned int i, dvs_voltage_nr = 8, ret;
         |                         ^~~~~~~~~~~~~~
   drivers/regulator/s5m8767.c:528:22: warning: unused variable 'i' [-Wunused-variable]
     528 |         unsigned int i, dvs_voltage_nr = 8, ret;
         |                      ^
   drivers/regulator/s5m8767.c: In function 's5m8767_pmic_probe':
   drivers/regulator/s5m8767.c:798:23: error: implicit declaration of function 'devm_gpio_request'; did you mean 'devm_gpiod_put'? [-Wimplicit-function-declaration]
     798 |                 ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[0],
         |                       ^~~~~~~~~~~~~~~~~
         |                       devm_gpiod_put
   drivers/regulator/s5m8767.c:814:17: error: implicit declaration of function 'gpio_direction_output'; did you mean 'gpiod_direction_output'? [-Wimplicit-function-declaration]
     814 |                 gpio_direction_output(pdata->buck_gpios[0],
         |                 ^~~~~~~~~~~~~~~~~~~~~
         |                 gpiod_direction_output
   drivers/regulator/s5m8767.c: At top level:
   drivers/regulator/s5m8767.c:988:40: error: array type has incomplete element type 'struct platform_device_id'
     988 | static const struct platform_device_id s5m8767_pmic_id[] = {
         |                                        ^~~~~~~~~~~~~~~
   drivers/regulator/s5m8767.c:503:12: warning: 's5m8767_pmic_dt_parse_ds_gpio' defined but not used [-Wunused-function]
     503 | static int s5m8767_pmic_dt_parse_ds_gpio(struct sec_pmic_dev *iodev,
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/s5m8767.c:485:12: warning: 's5m8767_pmic_dt_parse_dvs_gpio' defined but not used [-Wunused-function]
     485 | static int s5m8767_pmic_dt_parse_dvs_gpio(struct sec_pmic_dev *iodev,
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   drivers/nfc/nfcmrvl/uart.c: In function 'nfcmrvl_uart_parse_dt':
   drivers/nfc/nfcmrvl/uart.c:65:24: error: implicit declaration of function 'of_get_compatible_child' [-Wimplicit-function-declaration]
      65 |         matched_node = of_get_compatible_child(node, "marvell,nfc-uart");
         |                        ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/nfc/nfcmrvl/uart.c:65:22: error: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      65 |         matched_node = of_get_compatible_child(node, "marvell,nfc-uart");
         |                      ^
   drivers/nfc/nfcmrvl/uart.c:67:30: error: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      67 |                 matched_node = of_get_compatible_child(node, "mrvl,nfc-uart");
         |                              ^
   drivers/nfc/nfcmrvl/uart.c:75:17: error: implicit declaration of function 'of_node_put' [-Wimplicit-function-declaration]
      75 |                 of_node_put(matched_node);
         |                 ^~~~~~~~~~~
   drivers/nfc/nfcmrvl/uart.c:79:31: error: implicit declaration of function 'of_property_read_bool' [-Wimplicit-function-declaration]
      79 |         pdata->flow_control = of_property_read_bool(matched_node, "flow-control");
         |                               ^~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for GET_FREE_REGION
   Depends on [n]: SPARSEMEM [=n]
   Selected by [m]:
   - RESOURCE_KUNIT_TEST [=m] && RUNTIME_TESTING_MENU [=y] && KUNIT [=m]


vim +536 drivers/regulator/s5m8767.c

26aec009f6b61c Amit Daniel Kachhap      2013-02-03  520  
cbb0ed495ca165 Axel Lin                 2013-02-13  521  static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  522  					struct sec_platform_data *pdata)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  523  {
cbb0ed495ca165 Axel Lin                 2013-02-13  524  	struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
34a3f95941e0df Krzysztof Kozlowski      2024-08-14  525  	struct device_node *pmic_np, *reg_np;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  526  	struct sec_regulator_data *rdata;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  527  	struct sec_opmode_data *rmode;
04f9f068a619cc Chanwoo Choi             2013-10-10  528  	unsigned int i, dvs_voltage_nr = 8, ret;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  529  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  530  	pmic_np = iodev->dev->of_node;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  531  	if (!pmic_np) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  532  		dev_err(iodev->dev, "could not find pmic sub-node\n");
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  533  		return -ENODEV;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  534  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  535  
34a3f95941e0df Krzysztof Kozlowski      2024-08-14 @536  	struct device_node *regulators_np __free(device_node) = of_get_child_by_name(pmic_np,
34a3f95941e0df Krzysztof Kozlowski      2024-08-14  537  										     "regulators");
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  538  	if (!regulators_np) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  539  		dev_err(iodev->dev, "could not find regulators sub-node\n");
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  540  		return -EINVAL;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  541  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  542  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  543  	/* count the number of regulators to be supported in pmic */
1f91b6f6c747d3 Axel Lin                 2013-02-06  544  	pdata->num_regulators = of_get_child_count(regulators_np);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  545  
a86854d0c599b3 Kees Cook                2018-06-12  546  	rdata = devm_kcalloc(&pdev->dev,
a86854d0c599b3 Kees Cook                2018-06-12  547  			     pdata->num_regulators, sizeof(*rdata),
a86854d0c599b3 Kees Cook                2018-06-12  548  			     GFP_KERNEL);
34a3f95941e0df Krzysztof Kozlowski      2024-08-14  549  	if (!rdata)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  550  		return -ENOMEM;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  551  
a86854d0c599b3 Kees Cook                2018-06-12  552  	rmode = devm_kcalloc(&pdev->dev,
a86854d0c599b3 Kees Cook                2018-06-12  553  			     pdata->num_regulators, sizeof(*rmode),
a86854d0c599b3 Kees Cook                2018-06-12  554  			     GFP_KERNEL);
34a3f95941e0df Krzysztof Kozlowski      2024-08-14  555  	if (!rmode)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  556  		return -ENOMEM;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  557  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  558  	pdata->regulators = rdata;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  559  	pdata->opmode = rmode;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  560  	for_each_child_of_node(regulators_np, reg_np) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  561  		for (i = 0; i < ARRAY_SIZE(regulators); i++)
c32569e358adea Rob Herring              2018-12-05  562  			if (of_node_name_eq(reg_np, regulators[i].name))
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  563  				break;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  564  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  565  		if (i == ARRAY_SIZE(regulators)) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  566  			dev_warn(iodev->dev,
0c9721a5d1dea7 Rob Herring              2018-08-27  567  			"don't know how to configure regulator %pOFn\n",
0c9721a5d1dea7 Rob Herring              2018-08-27  568  			reg_np);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  569  			continue;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  570  		}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  571  
5be0e549e18f8a Dmitry Torokhov          2019-10-04  572  		rdata->ext_control_gpiod = devm_fwnode_gpiod_get(
63239e4bf7eff3 Linus Walleij            2018-10-15  573  			&pdev->dev,
5be0e549e18f8a Dmitry Torokhov          2019-10-04  574  			of_fwnode_handle(reg_np),
5be0e549e18f8a Dmitry Torokhov          2019-10-04  575  			"s5m8767,pmic-ext-control",
63239e4bf7eff3 Linus Walleij            2018-10-15  576  			GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
9ae5cc75ceaacf Linus Walleij            2018-05-14  577  			"s5m8767");
dea6dd2ba63f8c Pan Bian                 2021-01-20  578  		if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT) {
025bf37725f192 Waibel Georg             2019-06-20  579  			rdata->ext_control_gpiod = NULL;
dea6dd2ba63f8c Pan Bian                 2021-01-20  580  		} else if (IS_ERR(rdata->ext_control_gpiod)) {
dea6dd2ba63f8c Pan Bian                 2021-01-20  581  			of_node_put(reg_np);
9ae5cc75ceaacf Linus Walleij            2018-05-14  582  			return PTR_ERR(rdata->ext_control_gpiod);
dea6dd2ba63f8c Pan Bian                 2021-01-20  583  		}
ee1e0994ab1bd3 Krzysztof Kozlowski      2014-01-24  584  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  585  		rdata->id = i;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  586  		rdata->initdata = of_get_regulator_init_data(
072e78b12bf518 Javier Martinez Canillas 2014-11-10  587  						&pdev->dev, reg_np,
072e78b12bf518 Javier Martinez Canillas 2014-11-10  588  						&regulators[i]);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  589  		rdata->reg_node = reg_np;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  590  		rdata++;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  591  		rmode->id = i;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  592  		if (of_property_read_u32(reg_np, "op_mode",
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  593  				&rmode->mode)) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  594  			dev_warn(iodev->dev,
f3c7f7b636ef50 Christophe JAILLET       2019-12-03  595  				"no op_mode property at %pOF\n",
7799167b7a14fe Rob Herring              2017-07-18  596  				reg_np);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  597  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  598  			rmode->mode = S5M8767_OPMODE_NORMAL_MODE;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  599  		}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  600  		rmode++;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  601  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  602  
5bd73a162bc881 Rob Herring              2023-03-10  603  	if (of_property_read_bool(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs")) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  604  		pdata->buck2_gpiodvs = true;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  605  
04f9f068a619cc Chanwoo Choi             2013-10-10  606  		if (of_property_read_u32_array(pmic_np,
04f9f068a619cc Chanwoo Choi             2013-10-10  607  				"s5m8767,pmic-buck2-dvs-voltage",
04f9f068a619cc Chanwoo Choi             2013-10-10  608  				pdata->buck2_voltage, dvs_voltage_nr)) {
04f9f068a619cc Chanwoo Choi             2013-10-10  609  			dev_err(iodev->dev, "buck2 voltages not specified\n");
04f9f068a619cc Chanwoo Choi             2013-10-10  610  			return -EINVAL;
04f9f068a619cc Chanwoo Choi             2013-10-10  611  		}
04f9f068a619cc Chanwoo Choi             2013-10-10  612  	}
04f9f068a619cc Chanwoo Choi             2013-10-10  613  
5bd73a162bc881 Rob Herring              2023-03-10  614  	if (of_property_read_bool(pmic_np, "s5m8767,pmic-buck3-uses-gpio-dvs")) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  615  		pdata->buck3_gpiodvs = true;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  616  
04f9f068a619cc Chanwoo Choi             2013-10-10  617  		if (of_property_read_u32_array(pmic_np,
04f9f068a619cc Chanwoo Choi             2013-10-10  618  				"s5m8767,pmic-buck3-dvs-voltage",
04f9f068a619cc Chanwoo Choi             2013-10-10  619  				pdata->buck3_voltage, dvs_voltage_nr)) {
04f9f068a619cc Chanwoo Choi             2013-10-10  620  			dev_err(iodev->dev, "buck3 voltages not specified\n");
04f9f068a619cc Chanwoo Choi             2013-10-10  621  			return -EINVAL;
04f9f068a619cc Chanwoo Choi             2013-10-10  622  		}
04f9f068a619cc Chanwoo Choi             2013-10-10  623  	}
04f9f068a619cc Chanwoo Choi             2013-10-10  624  
5bd73a162bc881 Rob Herring              2023-03-10  625  	if (of_property_read_bool(pmic_np, "s5m8767,pmic-buck4-uses-gpio-dvs")) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  626  		pdata->buck4_gpiodvs = true;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  627  
04f9f068a619cc Chanwoo Choi             2013-10-10  628  		if (of_property_read_u32_array(pmic_np,
04f9f068a619cc Chanwoo Choi             2013-10-10  629  				"s5m8767,pmic-buck4-dvs-voltage",
04f9f068a619cc Chanwoo Choi             2013-10-10  630  				pdata->buck4_voltage, dvs_voltage_nr)) {
04f9f068a619cc Chanwoo Choi             2013-10-10  631  			dev_err(iodev->dev, "buck4 voltages not specified\n");
04f9f068a619cc Chanwoo Choi             2013-10-10  632  			return -EINVAL;
04f9f068a619cc Chanwoo Choi             2013-10-10  633  		}
04f9f068a619cc Chanwoo Choi             2013-10-10  634  	}
04f9f068a619cc Chanwoo Choi             2013-10-10  635  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  636  	if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  637  						pdata->buck4_gpiodvs) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  638  		ret = s5m8767_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  639  		if (ret)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  640  			return -EINVAL;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  641  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  642  		if (of_property_read_u32(pmic_np,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  643  				"s5m8767,pmic-buck-default-dvs-idx",
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  644  				&pdata->buck_default_idx)) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  645  			pdata->buck_default_idx = 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  646  		} else {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  647  			if (pdata->buck_default_idx >= 8) {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  648  				pdata->buck_default_idx = 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  649  				dev_info(iodev->dev,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  650  				"invalid value for default dvs index, use 0\n");
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  651  			}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  652  		}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  653  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  654  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  655  	ret = s5m8767_pmic_dt_parse_ds_gpio(iodev, pdata, pmic_np);
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  656  	if (ret)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  657  		return -EINVAL;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  658  
5bd73a162bc881 Rob Herring              2023-03-10  659  	pdata->buck2_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck2-ramp-enable");
5bd73a162bc881 Rob Herring              2023-03-10  660  	pdata->buck3_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck3-ramp-enable");
5bd73a162bc881 Rob Herring              2023-03-10  661  	pdata->buck4_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck4-ramp-enable");
033054e8603036 Chanwoo Choi             2013-10-10  662  
033054e8603036 Chanwoo Choi             2013-10-10  663  	if (pdata->buck2_ramp_enable || pdata->buck3_ramp_enable
033054e8603036 Chanwoo Choi             2013-10-10  664  			|| pdata->buck4_ramp_enable) {
033054e8603036 Chanwoo Choi             2013-10-10  665  		if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay",
033054e8603036 Chanwoo Choi             2013-10-10  666  				&pdata->buck_ramp_delay))
033054e8603036 Chanwoo Choi             2013-10-10  667  			pdata->buck_ramp_delay = 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  668  	}
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  669  
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  670  	return 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  671  }
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  672  #else
cbb0ed495ca165 Axel Lin                 2013-02-13  673  static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  674  					struct sec_platform_data *pdata)
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  675  {
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  676  	return 0;
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  677  }
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  678  #endif /* CONFIG_OF */
26aec009f6b61c Amit Daniel Kachhap      2013-02-03  679
diff mbox series

Patch

diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index d0f66a5e1b2a..bf6774632b5e 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -10,11 +10,6 @@ 
 #ifndef __LINUX_OF_GPIO_H
 #define __LINUX_OF_GPIO_H
 
-#include <linux/compiler.h>
-#include <linux/gpio/driver.h>
-#include <linux/gpio.h>		/* FIXME: Shouldn't be here */
-#include <linux/of.h>
-
 struct device_node;
 
 #ifdef CONFIG_OF_GPIO