public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Kirkwood: convert ns2 boards to pinctrl
Date: Tue, 8 Jan 2013 17:15:53 +0100	[thread overview]
Message-ID: <20130108161553.GE3392@lunn.ch> (raw)
In-Reply-To: <1357655778-32066-1-git-send-email-simon.guinot@sequanux.org>

On Tue, Jan 08, 2013 at 03:36:18PM +0100, Simon Guinot wrote:
> Note that the pinctrl conversion also fixes GPIO support for ns2 boards.
> Since commit f9e75922: "ARM: Kirkwood: Make use of mvebu pincltl and
> gpio", the mvbu_gpio driver is used for DT boards. As mvbu_gpio relies
> on the pinctrl driver, then a pinctrl definition must be given to allow
> the GPIO configuration.
> 
> Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
> ---
>  arch/arm/boot/dts/kirkwood-ns2-common.dtsi |   16 ++++++++++++
>  arch/arm/mach-kirkwood/board-ns2.c         |   38 ----------------------------
>  2 files changed, 16 insertions(+), 38 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
> index 9bc6785..77d21ab 100644
> --- a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
> +++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
> @@ -1,4 +1,5 @@
>  /include/ "kirkwood.dtsi"
> +/include/ "kirkwood-6281.dtsi"
>  
>  / {
>  	chosen {
> @@ -6,6 +7,21 @@
>  	};
>  
>  	ocp at f1000000 {
> +		pinctrl: pinctrl at 10000 {
> +			pinctrl-0 = < &pmx_spi &pmx_twsi0 &pmx_uart0
> +					&pmx_ns2_sata0 &pmx_ns2_sata1>;
> +			pinctrl-names = "default";
> +
> +			pmx_ns2_sata0: pmx-ns2-sata0 {
> +				marvell,pins = "mpp21";
> +				marvell,function = "sata0";
> +			};
> +			pmx_ns2_sata1: pmx-ns2-sata1 {
> +				marvell,pins = "mpp20";
> +				marvell,function = "sata1";
> +			};
> +		};
> +
>  		serial at 12000 {
>  			clock-frequency = <166666667>;
>  			status = "okay";
> diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c
> index 8821720..f4632a8 100644
> --- a/arch/arm/mach-kirkwood/board-ns2.c
> +++ b/arch/arm/mach-kirkwood/board-ns2.c
> @@ -18,47 +18,11 @@
>  #include <linux/gpio.h>
>  #include <linux/of.h>
>  #include "common.h"
> -#include "mpp.h"
>  
>  static struct mv643xx_eth_platform_data ns2_ge00_data = {
>  	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
>  };
>  
> -static unsigned int ns2_mpp_config[] __initdata = {
> -	MPP0_SPI_SCn,
> -	MPP1_SPI_MOSI,
> -	MPP2_SPI_SCK,
> -	MPP3_SPI_MISO,
> -	MPP4_NF_IO6,
> -	MPP5_NF_IO7,
> -	MPP6_SYSRST_OUTn,
> -	MPP7_GPO,		/* Fan speed (bit 1) */
> -	MPP8_TW0_SDA,
> -	MPP9_TW0_SCK,
> -	MPP10_UART0_TXD,
> -	MPP11_UART0_RXD,
> -	MPP12_GPO,		/* Red led */
> -	MPP14_GPIO,		/* USB fuse */
> -	MPP16_GPIO,		/* SATA 0 power */
> -	MPP17_GPIO,		/* SATA 1 power */
> -	MPP18_NF_IO0,
> -	MPP19_NF_IO1,
> -	MPP20_SATA1_ACTn,
> -	MPP21_SATA0_ACTn,
> -	MPP22_GPIO,		/* Fan speed (bit 0) */
> -	MPP23_GPIO,		/* Fan power */
> -	MPP24_GPIO,		/* USB mode select */
> -	MPP25_GPIO,		/* Fan rotation fail */
> -	MPP26_GPIO,		/* USB device vbus */
> -	MPP28_GPIO,		/* USB enable host vbus */
> -	MPP29_GPIO,		/* Blue led (slow register) */
> -	MPP30_GPIO,		/* Blue led (command register) */
> -	MPP31_GPIO,		/* Board power off */
> -	MPP32_GPIO,		/* Power button (0 = Released, 1 = Pushed) */
> -	MPP33_GPO,		/* Fan speed (bit 2) */
> -	0
> -};
> -
>  #define NS2_GPIO_POWER_OFF	31
>  
>  static void ns2_power_off(void)
> @@ -71,8 +35,6 @@ void __init ns2_init(void)
>  	/*
>  	 * Basic setup. Needs to be called early.
>  	 */
> -	kirkwood_mpp_conf(ns2_mpp_config);
> -
>  	if (of_machine_is_compatible("lacie,netspace_lite_v2") ||
>  	    of_machine_is_compatible("lacie,netspace_mini_v2"))
>  		ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
> -- 
> 1.7.10
> 

Acked-by: Andrew Lunn <andrew@lunn.ch>

	  Andrew

  parent reply	other threads:[~2013-01-08 16:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-08 14:36 [PATCH] ARM: Kirkwood: convert ns2 boards to pinctrl Simon Guinot
2013-01-08 14:49 ` Andrew Lunn
2013-01-08 15:09   ` Simon Guinot
2013-01-08 16:13     ` Andrew Lunn
2013-01-08 16:21       ` Thomas Petazzoni
2013-01-08 16:15 ` Andrew Lunn [this message]
2013-01-08 16:18   ` Simon Guinot
2013-01-08 16:30     ` Andrew Lunn
2013-01-08 16:39       ` Jason Cooper
2013-01-08 16:55         ` Simon Guinot
2013-01-08 17:07           ` Jason Cooper
2013-01-08 17:51             ` Simon Guinot
2013-01-10  1:32 ` Jason Cooper

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=20130108161553.GE3392@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-arm-kernel@lists.infradead.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