linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@siol.net>
To: Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
	Andre Przywara <andre.przywara@arm.com>
Cc: Icenowy Zheng <icenowy@aosc.xyz>,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@googlegroups.com,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Yangtao Li <frank@allwinnertech.com>,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
	Andre Przywara <andre.przywara@arm.com>
Subject: Re: [PATCH 3/8] pinctrl: sunxi: Add support for the Allwinner H616-R pin controller
Date: Wed, 02 Dec 2020 18:55:32 +0100	[thread overview]
Message-ID: <47263727.bh6W02dunB@kista> (raw)
In-Reply-To: <20201202135409.13683-4-andre.przywara@arm.com>

Dne sreda, 02. december 2020 ob 14:54:04 CET je Andre Przywara napisal(a):
> There are only two pins left now, used to connect to the PMIC via I2C.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  drivers/pinctrl/sunxi/Kconfig                 |  5 ++
>  drivers/pinctrl/sunxi/Makefile                |  1 +
>  drivers/pinctrl/sunxi/pinctrl-sun50i-h616-r.c | 58 +++++++++++++++++++
>  3 files changed, 64 insertions(+)
>  create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun50i-h616-r.c
> 
> diff --git a/drivers/pinctrl/sunxi/Kconfig b/drivers/pinctrl/sunxi/Kconfig
> index 73e88ce71a48..33751a6a0757 100644
> --- a/drivers/pinctrl/sunxi/Kconfig
> +++ b/drivers/pinctrl/sunxi/Kconfig
> @@ -124,4 +124,9 @@ config PINCTRL_SUN50I_H616
>  	default ARM64 && ARCH_SUNXI
>  	select PINCTRL_SUNXI
>  
> +config PINCTRL_SUN50I_H616_R
> +	bool "Support for the Allwinner H616 R-PIO"
> +	default ARM64 && ARCH_SUNXI
> +	select PINCTRL_SUNXI
> +
>  endif
> diff --git a/drivers/pinctrl/sunxi/Makefile b/drivers/pinctrl/sunxi/Makefile
> index 5359327a3c8f..d3440c42b9d6 100644
> --- a/drivers/pinctrl/sunxi/Makefile
> +++ b/drivers/pinctrl/sunxi/Makefile
> @@ -24,5 +24,6 @@ obj-$(CONFIG_PINCTRL_SUN50I_H5)		+= 
pinctrl-sun50i-h5.o
>  obj-$(CONFIG_PINCTRL_SUN50I_H6)		+= pinctrl-sun50i-h6.o
>  obj-$(CONFIG_PINCTRL_SUN50I_H6_R)	+= pinctrl-sun50i-h6-r.o
>  obj-$(CONFIG_PINCTRL_SUN50I_H616)	+= pinctrl-sun50i-h616.o
> +obj-$(CONFIG_PINCTRL_SUN50I_H616_R)	+= pinctrl-sun50i-h616-r.o
>  obj-$(CONFIG_PINCTRL_SUN9I_A80)		+= pinctrl-sun9i-a80.o
>  obj-$(CONFIG_PINCTRL_SUN9I_A80_R)	+= pinctrl-sun9i-a80-r.o
> diff --git a/drivers/pinctrl/sunxi/pinctrl-sun50i-h616-r.c b/drivers/pinctrl/
sunxi/pinctrl-sun50i-h616-r.c
> new file mode 100644
> index 000000000000..eb76c009bf24
> --- /dev/null
> +++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-h616-r.c
> @@ -0,0 +1,58 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Allwinner H616 R_PIO pin controller driver
> + *
> + * Copyright (C) 2020 Arm Ltd.
> + * Based on former work, which is:
> + *   Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
> + *   Copyright (C) 2014 Boris Brezillon
> + *   Boris Brezillon <boris.brezillon@free-electrons.com>
> + *   Copyright (C) 2014 Maxime Ripard
> + *   Maxime Ripard <maxime.ripard@free-electrons.com>
> + */

I'm not sure if it makes sense to reference so many previous work for so 
simple driver...

Anyway:

Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>

Best regards,
Jernej

> +
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
> +#include <linux/pinctrl/pinctrl.h>
> +#include <linux/reset.h>
> +
> +#include "pinctrl-sunxi.h"
> +
> +static const struct sunxi_desc_pin sun50i_h616_r_pins[] = {
> +	SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0),
> +		  SUNXI_FUNCTION(0x0, "gpio_in"),
> +		  SUNXI_FUNCTION(0x1, "gpio_out"),
> +		  SUNXI_FUNCTION(0x3, "s_i2c")),	/* SCK */
> +	SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1),
> +		  SUNXI_FUNCTION(0x0, "gpio_in"),
> +		  SUNXI_FUNCTION(0x1, "gpio_out"),
> +		  SUNXI_FUNCTION(0x3, "s_i2c")),	/* SDA */
> +};
> +
> +static const struct sunxi_pinctrl_desc sun50i_h616_r_pinctrl_data = {
> +	.pins = sun50i_h616_r_pins,
> +	.npins = ARRAY_SIZE(sun50i_h616_r_pins),
> +	.pin_base = PL_BASE,
> +};
> +
> +static int sun50i_h616_r_pinctrl_probe(struct platform_device *pdev)
> +{
> +	return sunxi_pinctrl_init(pdev,
> +				  &sun50i_h616_r_pinctrl_data);
> +}
> +
> +static const struct of_device_id sun50i_h616_r_pinctrl_match[] = {
> +	{ .compatible = "allwinner,sun50i-h616-r-pinctrl", },
> +	{}
> +};
> +
> +static struct platform_driver sun50i_h616_r_pinctrl_driver = {
> +	.probe	= sun50i_h616_r_pinctrl_probe,
> +	.driver	= {
> +		.name		= "sun50i-h616-r-pinctrl",
> +		.of_match_table	= sun50i_h616_r_pinctrl_match,
> +	},
> +};
> +builtin_platform_driver(sun50i_h616_r_pinctrl_driver);
> -- 
> 2.17.5
> 
> 



  parent reply	other threads:[~2020-12-02 17:50 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02 13:54 [PATCH 0/8] arm64: sunxi: Initial Allwinner H616 SoC support Andre Przywara
2020-12-02 13:54 ` [PATCH 1/8] clk: sunxi-ng: h6: Fix clock divider range on some clocks Andre Przywara
2020-12-02 16:17   ` Jernej Škrabec
2020-12-02 13:54 ` [PATCH 2/8] pinctrl: sunxi: Add support for the Allwinner H616 pin controller Andre Przywara
2020-12-02 15:52   ` Maxime Ripard
2020-12-05 22:41     ` Linus Walleij
2020-12-02 18:15   ` Jernej Škrabec
2020-12-06 12:32   ` [linux-sunxi] " Clément Péron
2020-12-06 12:42     ` Jernej Škrabec
2020-12-06 14:52       ` André Przywara
2020-12-06 16:01         ` Icenowy Zheng
2020-12-07  1:07           ` André Przywara
2020-12-07  1:45             ` André Przywara
2020-12-13 16:27   ` Icenowy Zheng
2020-12-14  9:26     ` Chen-Yu Tsai
2020-12-02 13:54 ` [PATCH 3/8] pinctrl: sunxi: Add support for the Allwinner H616-R " Andre Przywara
2020-12-02 15:54   ` Maxime Ripard
2020-12-02 17:55   ` Jernej Škrabec [this message]
2020-12-02 13:54 ` [PATCH 4/8] clk: sunxi-ng: Add support for the Allwinner H616 R-CCU Andre Przywara
2020-12-02 14:31   ` Icenowy Zheng
2020-12-03 11:07     ` André Przywara
2020-12-03 14:02       ` [linux-sunxi] " Icenowy Zheng
2020-12-02 18:20   ` Jernej Škrabec
2020-12-03  2:44     ` Samuel Holland
2020-12-03 10:52     ` André Przywara
2020-12-02 13:54 ` [PATCH 5/8] clk: sunxi-ng: Add support for the Allwinner H616 CCU Andre Przywara
2020-12-02 15:56   ` Maxime Ripard
2020-12-02 21:03   ` Jernej Škrabec
2020-12-02 23:06     ` André Przywara
2020-12-05 16:36       ` [linux-sunxi] " Icenowy Zheng
2020-12-09 14:33   ` [linux-sunxi] " Clément Péron
2020-12-09 21:35     ` André Przywara
2020-12-09 22:20       ` Jernej Škrabec
2020-12-09 22:45         ` André Przywara
2020-12-10 13:31   ` Icenowy Zheng
2020-12-10 14:34     ` André Przywara
2020-12-02 13:54 ` [PATCH 6/8] mmc: sunxi: add support for A100 mmc controller Andre Przywara
2020-12-02 13:54 ` [PATCH 7/8] arm64: dts: allwinner: Add Allwinner H616 .dtsi file Andre Przywara
2020-12-02 16:03   ` Icenowy Zheng
2020-12-02 16:19     ` André Przywara
2020-12-02 16:05   ` Maxime Ripard
2020-12-02 16:13     ` Icenowy Zheng
2020-12-03  3:10     ` Samuel Holland
2020-12-02 16:33   ` Jernej Škrabec
2020-12-03  1:35     ` André Przywara
2020-12-03  3:16   ` Samuel Holland
2020-12-03 10:53     ` André Przywara
2020-12-03 15:02       ` [linux-sunxi] " Chen-Yu Tsai
2020-12-03 15:44         ` André Przywara
2020-12-03 16:20           ` Chen-Yu Tsai
2020-12-08  0:47             ` André Przywara
2020-12-02 13:54 ` [PATCH 8/8] arm64: dts: allwinner: Add OrangePi Zero 2 .dts Andre Przywara
2020-12-02 15:57   ` Icenowy Zheng
2020-12-02 16:43     ` André Przywara
2020-12-02 16:07   ` Maxime Ripard
2020-12-02 16:25     ` Jernej Škrabec
2020-12-06 12:51   ` [linux-sunxi] " Clément Péron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47263727.bh6W02dunB@kista \
    --to=jernej.skrabec@siol.net \
    --cc=andre.przywara@arm.com \
    --cc=frank@allwinnertech.com \
    --cc=icenowy@aosc.xyz \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=mripard@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).