]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: allows not to define the get_group_pins operation
authorAntoine Ténart <antoine.tenart@free-electrons.com>
Thu, 10 Apr 2014 13:07:50 +0000 (15:07 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 22 Apr 2014 12:47:02 +0000 (14:47 +0200)
commit72547a60038e60cd42f297ae2d539ac4463b6d06
tree787cdc0ff48a468a7a1f466c4bf60019eb99a30e
parent5e6a68c3bbfee6269980fa272e8dbbb31eac4176
pinctrl: allows not to define the get_group_pins operation

When using a group only pinctrl driver, which does not have any
information on the pins it is useless to define a get_group_pins
always returning an empty list of pins.

When not using get_group_pin[1], a driver must implement it so
pins = NULL and num_pins = 0. This patch makes it the default
behaviour if not defined in the pinctrl driver when used in
pinmux enable and disable funtions and in pinctrl_groups_show.

It also adds a check in pinctrl_get_group_pins and return -EINVAL if
not defined. This function is called in the gpiolib when adding when
pingroup range. It cannot be used if no group is defined, so this seams
reasonable.

[1] get_group_pin(struct pinctrl_dev *pctldev,
  unsigned selector,
  const unsigned **pins,
  unsigned *num_pins);

Signed-off-by: Antoine Ténart <antoine.tenart@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/core.c
drivers/pinctrl/pinmux.c