[PATCHv3] ARM: sunxi: gpio: Add Allwinner SoCs GPIO drivers

Ezequiel Garcia elezegarcia at gmail.com
Sat Jan 26 09:30:59 EST 2013


Hi Maxime,

On Sat, Jan 26, 2013 at 6:31 AM, Maxime Ripard
<maxime.ripard at free-electrons.com> wrote:
> The IP responsible for the muxing on the Allwinner SoCs are also
> handling the GPIOs on the system. This patch adds the needed driver that
> relies on the pinctrl driver for most of its operations.
>
> The number of pins available for GPIOs operations are already declared
> in the pinctrl driver, we only need to probe a generic driver to handle
> the banks available for each SoC.
>
> This driver has been tested on a A13-Olinuxino.
>
> Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
> ---
> Changes from v2:
>   - Removed the call to kzalloc to build the pin name
>
>  drivers/pinctrl/pinctrl-sunxi.c |  134 ++++++++++++++++++++++++++++++++++++++-
>  drivers/pinctrl/pinctrl-sunxi.h |   25 +++++++-
>  2 files changed, 156 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c
> index 6f02e34..4ed0e7e 100644
> --- a/drivers/pinctrl/pinctrl-sunxi.c
> +++ b/drivers/pinctrl/pinctrl-sunxi.c
> @@ -11,6 +11,7 @@
>   */
>
>  #include <linux/io.h>
> +#include <linux/gpio.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/of_address.h>
> @@ -609,11 +610,53 @@ static int sunxi_pmx_enable(struct pinctrl_dev *pctldev,
>         return 0;
>  }
>
> +static int
> +sunxi_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
> +                       struct pinctrl_gpio_range *range,
> +                       unsigned offset,
> +                       bool input)
> +{
> +       struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
> +       struct sunxi_desc_function *desc;
> +       char pin_name[SUNXI_PIN_NAME_MAX_LEN];
> +       char *func;

Nitpick: const char *func.

-- 
    Ezequiel



More information about the linux-arm-kernel mailing list