Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: linux-gpio@vger.kernel.org
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>,
	Daniel Mack <daniel@zonque.org>
Subject: gpio-pxa driver and pincontrol
Date: Wed, 11 Nov 2015 23:25:17 +0100	[thread overview]
Message-ID: <8761189nsi.fsf@belgarion.home> (raw)

Hi,

I've written a pinconf + pinmux driver for the pxa2xx architectures. Before
posting it I wanted to see the integration of the gpio driver and the pincontrol
one.

My trouble is that the gpio-pxa.c gpio driver adds one gpiochip for each bank,
ie. for pxa27x we have the output in [1], ie 4 gpiochips of 32 gpios each.

But the trick is that a single devicetree node triggers the creation of the 4
gpio chips :
		gpio: gpio@40e00000 {
			compatible = "mrvl,pxa-gpio";
			#address-cells = <0x1>;
			#size-cells = <0x1>;
			reg = <0x40e00000 0x10000>;
			gpio-controller;
			#gpio-cells = <0x2>;
			interrupts = <10>;
			interrupt-names = "gpio_mux";
			interrupt-controller;
			#interrupt-cells = <0x2>;
			ranges;

			gcb0: gpio@40e00000 {
				reg = <0x40e00000 0x4>;
			};

			gcb1: gpio@40e00004 {
				reg = <0x40e00004 0x4>;
			};

			gcb2: gpio@40e00008 {
				reg = <0x40e00008 0x4>;
			};
			gcb3: gpio@40e0000c {
				reg = <0x40e0000c 0x4>;
			};
		};

Now if I put a line like this (knowing the pinctrl has 128 pins) :
			gpio-ranges = <&pinctrl 0 0 128>;

It will add :
 - map pins 0..127 to gpio 0..31 on gpiochip0
 - map pins 0..127 to gpio 32..63 on gpiochip1
 - etc ...

Now the question, is there a way to fix this without changing the gpio-pxa
driver to add only 1 gpiochip ?

Cheers.

-- 
Robert

[1] $ cat /sys/kernel/debug/gpio
GPIOs 0-31, gpio-0:
 gpio-0   (GPIO Key Power      ) in  lo    
 gpio-10  (?                   ) out hi    
 gpio-12  (HP jack detect      ) in  lo    
 gpio-22  (?                   ) out hi    
 gpio-23  (sysfs               ) out hi    
 gpio-24  (sysfs               ) out lo    
 gpio-26  (sysfs               ) out lo    
 gpio-27  (sysfs               ) out lo    

GPIOs 32-63, gpio-1:
 gpio-56  (mt9m111 #OE         ) in  hi    

GPIOs 64-95, gpio-2:
 gpio-77  (sysfs               ) out hi    
 gpio-82  (?                   ) out hi    
 gpio-83  (sysfs               ) out hi    
 gpio-86  (sysfs               ) out hi    
 gpio-88  (sysfs               ) out hi    
 gpio-90  (sysfs               ) out hi    
 gpio-93  (Volume Up Key       ) in  lo    
 gpio-94  (Volume Down Key     ) in  lo    

GPIOs 96-120, gpio-3:
 gpio-97  (?                   ) out lo    
 gpio-98  (?                   ) out hi    
 gpio-106 (sysfs               ) out lo    
 gpio-107 (sysfs               ) out lo    
 gpio-114 (sysfs               ) out hi    
 gpio-115 (?                   ) out hi    

                 reply	other threads:[~2015-11-11 22:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=8761189nsi.fsf@belgarion.home \
    --to=robert.jarzmik@free.fr \
    --cc=daniel@zonque.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-gpio@vger.kernel.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