Re: [PATCH 2/2] pinctrl: tegra: Add driver to configure voltage and power of io pads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laxman,

[auto build test ERROR on tegra/for-next]
[also build test ERROR on v4.9-rc3 next-20161028]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Laxman-Dewangan/pinctrl-tegra-Add-support-for-IO-pad-control/20161102-173122
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

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

>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:42:20: error: field 'pad_id' has incomplete type
     enum tegra_io_pad pad_id;
                       ^~~~~~
   drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c: In function 'tegra_io_pad_pinconf_get':
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:103:7: error: variable 'pad_id' has initializer but incomplete type
     enum tegra_io_pad pad_id = pad_cfg->pad_id;
          ^~~~~~~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:103:20: error: storage size of 'pad_id' isn't known
     enum tegra_io_pad pad_id = pad_cfg->pad_id;
                       ^~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:109:9: error: implicit declaration of function 'tegra_io_pad_get_voltage' [-Werror=implicit-function-declaration]
      ret = tegra_io_pad_get_voltage(pad_id);
            ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:116:9: error: implicit declaration of function 'tegra_io_pad_power_get_status' [-Werror=implicit-function-declaration]
      ret = tegra_io_pad_power_get_status(pad_id);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:103:20: warning: unused variable 'pad_id' [-Wunused-variable]
     enum tegra_io_pad pad_id = pad_cfg->pad_id;
                       ^~~~~~
   drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c: In function 'tegra_io_pad_pinconf_set':
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:150:10: error: implicit declaration of function 'tegra_io_pad_set_voltage' [-Werror=implicit-function-declaration]
       ret = tegra_io_pad_set_voltage(pad_id, param_val);
             ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:161:11: error: implicit declaration of function 'tegra_io_pad_power_disable' [-Werror=implicit-function-declaration]
        ret = tegra_io_pad_power_disable(pad_id);
              ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:163:11: error: implicit declaration of function 'tegra_io_pad_power_enable' [-Werror=implicit-function-declaration]
        ret = tegra_io_pad_power_enable(pad_id);
              ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c: At top level:
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:307:13: error: 'TEGRA_IO_PAD_AUDIO' undeclared here (not in a function)
      .pad_id = TEGRA_IO_PAD_##_pad_id,   \
                ^
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:232:2: note: in expansion of macro 'TEGRA_IO_PAD_INFO'
     _entry_(0, "audio", AUDIO, true, false),  \
     ^~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:313:2: note: in expansion of macro 'TEGRA124_PAD_INFO_TABLE'
     TEGRA124_PAD_INFO_TABLE(TEGRA_IO_PAD_INFO),
     ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:307:13: error: 'TEGRA_IO_PAD_BB' undeclared here (not in a function)
      .pad_id = TEGRA_IO_PAD_##_pad_id,   \
                ^
   drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:233:2: note: in expansion of macro 'TEGRA_IO_PAD_INFO'
     _entry_(1, "bb", BB, true, false),   \
     ^~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:313:2: note: in expansion of macro 'TEGRA124_PAD_INFO_TABLE'
     TEGRA124_PAD_INFO_TABLE(TEGRA_IO_PAD_INFO),
     ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:307:13: error: 'TEGRA_IO_PAD_CAM' undeclared here (not in a function)
      .pad_id = TEGRA_IO_PAD_##_pad_id,   \
                ^
   drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:234:2: note: in expansion of macro 'TEGRA_IO_PAD_INFO'
     _entry_(2, "cam", CAM, true, false),   \
     ^~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:313:2: note: in expansion of macro 'TEGRA124_PAD_INFO_TABLE'
     TEGRA124_PAD_INFO_TABLE(TEGRA_IO_PAD_INFO),
     ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:307:13: error: 'TEGRA_IO_PAD_COMP' undeclared here (not in a function)
      .pad_id = TEGRA_IO_PAD_##_pad_id,   \
                ^
   drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:235:2: note: in expansion of macro 'TEGRA_IO_PAD_INFO'
     _entry_(3, "comp", COMP, true, false),   \
     ^~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:313:2: note: in expansion of macro 'TEGRA124_PAD_INFO_TABLE'
     TEGRA124_PAD_INFO_TABLE(TEGRA_IO_PAD_INFO),
     ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:307:13: error: 'TEGRA_IO_PAD_CSIA' undeclared here (not in a function)
      .pad_id = TEGRA_IO_PAD_##_pad_id,   \
                ^
   drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:236:2: note: in expansion of macro 'TEGRA_IO_PAD_INFO'
     _entry_(4, "csia", CSIA, true, false),   \
     ^~~~~~~
>> drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c:313:2: note: in expansion of macro 'TEGRA124_PAD_INFO_TABLE'
     TEGRA124_PAD_INFO_TABLE(TEGRA_IO_PAD_INFO),
     ^~~~~~~~~~~~~~~~~~~~~~~

vim +/pad_id +42 drivers/pinctrl/tegra/pinctrl-tegra-io-pad.c

    36		},
    37	};
    38	
    39	struct tegra_io_pads_cfg_info {
    40		const char *name;
    41		const unsigned int pins[1];
  > 42		enum tegra_io_pad pad_id;
    43		bool voltage_can_change;
    44		bool support_low_power_state;
    45	};
    46	
    47	struct tegra_io_pad_soc_data {
    48		const struct tegra_io_pads_cfg_info *pads_cfg;
    49		int num_pads_cfg;
    50		const struct pinctrl_pin_desc *pins_desc;
    51		int num_pins_desc;
    52	};
    53	
    54	struct tegra_io_pads_info {
    55		struct device *dev;
    56		struct pinctrl_dev *pctl;
    57		const struct tegra_io_pad_soc_data *soc_data;
    58	};
    59	
    60	static int tegra_iop_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
    61	{
    62		struct tegra_io_pads_info *tiopi = pinctrl_dev_get_drvdata(pctldev);
    63	
    64		return tiopi->soc_data->num_pads_cfg;
    65	}
    66	
    67	static const char *tegra_iop_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
    68							    unsigned int group)
    69	{
    70		struct tegra_io_pads_info *tiopi = pinctrl_dev_get_drvdata(pctldev);
    71	
    72		return tiopi->soc_data->pads_cfg[group].name;
    73	}
    74	
    75	static int tegra_iop_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
    76						    unsigned int group,
    77						    const unsigned int **pins,
    78						    unsigned int *num_pins)
    79	{
    80		struct tegra_io_pads_info *tiopi = pinctrl_dev_get_drvdata(pctldev);
    81	
    82		*pins = tiopi->soc_data->pads_cfg[group].pins;
    83		*num_pins = 1;
    84	
    85		return 0;
    86	}
    87	
    88	static const struct pinctrl_ops tegra_iop_pinctrl_ops = {
    89		.get_groups_count	= tegra_iop_pinctrl_get_groups_count,
    90		.get_group_name		= tegra_iop_pinctrl_get_group_name,
    91		.get_group_pins		= tegra_iop_pinctrl_get_group_pins,
    92		.dt_node_to_map		= pinconf_generic_dt_node_to_map_pin,
    93		.dt_free_map		= pinctrl_utils_free_map,
    94	};
    95	
    96	static int tegra_io_pad_pinconf_get(struct pinctrl_dev *pctldev,
    97					    unsigned int pin, unsigned long *config)
    98	{
    99		struct tegra_io_pads_info *tiopi = pinctrl_dev_get_drvdata(pctldev);
   100		int param = pinconf_to_config_param(*config);
   101		const struct tegra_io_pads_cfg_info *pad_cfg =
   102						&tiopi->soc_data->pads_cfg[pin];
 > 103		enum tegra_io_pad pad_id = pad_cfg->pad_id;
   104		int arg = 0;
   105		int ret;
   106	
   107		switch (param) {
   108		case TEGRA_IO_PAD_POWER_SOURCE_VOLTAGE:
 > 109			ret = tegra_io_pad_get_voltage(pad_id);
   110			if (ret < 0)
   111				return ret;
   112			arg = ret;
   113			break;
   114	
   115		case PIN_CONFIG_LOW_POWER_MODE:
 > 116			ret = tegra_io_pad_power_get_status(pad_id);
   117			if (ret < 0)
   118				return ret;
   119			arg = !ret;
   120			break;
   121	
   122		default:
   123			dev_err(tiopi->dev, "The parameter %d not supported\n", param);
   124			return -EINVAL;
   125		}
   126	
   127		*config = pinconf_to_config_packed(param, (u16)arg);
   128		return 0;
   129	}
   130	
   131	static int tegra_io_pad_pinconf_set(struct pinctrl_dev *pctldev,
   132					    unsigned int pin, unsigned long *configs,
   133					    unsigned int num_configs)
   134	{
   135		struct tegra_io_pads_info *tiopi = pinctrl_dev_get_drvdata(pctldev);
   136		const struct tegra_io_pads_cfg_info *pad_cfg =
   137						&tiopi->soc_data->pads_cfg[pin];
   138		int pad_id = pad_cfg->pad_id;
   139		u16 param_val;
   140		int param;
   141		int ret;
   142		int i;
   143	
   144		for (i = 0; i < num_configs; i++) {
   145			param = pinconf_to_config_param(configs[i]);
   146			param_val = pinconf_to_config_argument(configs[i]);
   147	
   148			switch (param) {
   149			case TEGRA_IO_PAD_POWER_SOURCE_VOLTAGE:
 > 150				ret = tegra_io_pad_set_voltage(pad_id, param_val);
   151				if (ret < 0) {
   152					dev_err(tiopi->dev,
   153						"Failed to set voltage %d of pin %u: %d\n",
   154						param_val, pin, ret);
   155					return ret;
   156				}
   157				break;
   158	
   159			case PIN_CONFIG_LOW_POWER_MODE:
   160				if (param_val)
 > 161					ret = tegra_io_pad_power_disable(pad_id);
   162				else
 > 163					ret = tegra_io_pad_power_enable(pad_id);
   164				if (ret < 0) {
   165					dev_err(tiopi->dev,
   166						"Failed to set DPD %d of pin %u: %d\n",
   167						param_val, pin, ret);
   168					return ret;
   169				}
   170				break;
   171	
   172			default:
   173				dev_err(tiopi->dev, "The parameter %d not supported\n",
   174					param);
   175				return -EINVAL;
   176			}
   177		}
   178	
   179		return 0;
   180	}
   181	
   182	static const struct pinconf_ops tegra_io_pad_pinconf_ops = {
   183		.pin_config_get = tegra_io_pad_pinconf_get,
   184		.pin_config_set = tegra_io_pad_pinconf_set,
   185	};
   186	
   187	static struct pinctrl_desc tegra_iop_pinctrl_desc = {
   188		.name = "pinctrl-tegra-io-pads",
   189		.pctlops = &tegra_iop_pinctrl_ops,
   190		.confops = &tegra_io_pad_pinconf_ops,
   191		.custom_params = tegra_io_pads_cfg_params,
   192		.num_custom_params = ARRAY_SIZE(tegra_io_pads_cfg_params),
   193	};
   194	
   195	static int tegra_iop_pinctrl_probe(struct platform_device *pdev)
   196	{
   197		struct device *dev = &pdev->dev;
   198		const struct platform_device_id *id = platform_get_device_id(pdev);
   199		struct device_node *np_parent = pdev->dev.parent->of_node;
   200		struct tegra_io_pads_info *tiopi;
   201	
   202		if (!np_parent) {
   203			dev_err(&pdev->dev, "PMC should be register from DT\n");
   204			return -ENODEV;
   205		}
   206	
   207		tiopi = devm_kzalloc(&pdev->dev, sizeof(*tiopi), GFP_KERNEL);
   208		if (!tiopi)
   209			return -ENOMEM;
   210	
   211		tiopi->dev = &pdev->dev;
   212		pdev->dev.of_node = np_parent;
   213		tiopi->soc_data = (const struct tegra_io_pad_soc_data *)id->driver_data;
   214		tegra_iop_pinctrl_desc.pins = tiopi->soc_data->pins_desc;
   215		tegra_iop_pinctrl_desc.npins = tiopi->soc_data->num_pins_desc;
   216		platform_set_drvdata(pdev, tiopi);
   217	
   218		tiopi->pctl = devm_pinctrl_register(dev, &tegra_iop_pinctrl_desc,
   219						    tiopi);
   220		if (IS_ERR(tiopi->pctl)) {
   221			int ret = PTR_ERR(tiopi->pctl);
   222	
   223			dev_err(dev, "Failed to register io-pad pinctrl driver: %d\n",
   224				ret);
   225			return ret;
   226		}
   227	
   228		return 0;
   229	}
   230	
   231	#define TEGRA124_PAD_INFO_TABLE(_entry_)			\
 > 232		_entry_(0, "audio", AUDIO, true, false),		\
   233		_entry_(1, "bb", BB, true, false),			\
   234		_entry_(2, "cam", CAM, true, false),			\
   235		_entry_(3, "comp", COMP, true, false),			\

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux