linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Alexandre Courbot <gnurou@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-pcmcia@lists.infradead.org,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	linux-gpio@vger.kernel.org,
	Kristoffer Ericson <kristoffer.ericson@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	Daniel Mack <daniel@zonque.org>
Subject: Re: [PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver
Date: Wed, 31 Aug 2016 11:27:21 +0100	[thread overview]
Message-ID: <20160831102721.GR1041@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20160831084938.GQ1041@n2100.armlinux.org.uk>

On Wed, Aug 31, 2016 at 09:49:38AM +0100, Russell King - ARM Linux wrote:
> On Tue, Aug 30, 2016 at 11:32:16PM +0200, Robert Jarzmik wrote:
> > Russell King - ARM Linux <linux@armlinux.org.uk> writes:
> > 
> > > If you can wait a day or two, I'll push a branch out for everything in
> > > all these multiple series.
> > Sure, just ping me when you have something.
> 
> git://git.armlinux.org.uk/~rmk/linux-arm.git sa1100
> 
> should get you something suitable to test.  It's based on 4.7-rc3 plus
> my fixes branch.
> 
> It would be great to have this tested on Lubbock, and get the PCMCIA
> issues fixed.  Maybe we can look at converting mainstone as well?

Yes, looking at mainstone's PCMCIA, it uses a MAX1602 device, which
is supported by the new max1600.c code.

#define MST_PCMCIA_PWR_VPP_0    0x0        /* voltage VPP = 0V */
#define MST_PCMCIA_PWR_VPP_120  0x2        /* voltage VPP = 12V*/
#define MST_PCMCIA_PWR_VPP_VCC  0x1        /* voltage VPP = VCC */
#define MST_PCMCIA_PWR_VCC_0    0x0        /* voltage VCC = 0V */
#define MST_PCMCIA_PWR_VCC_33   0x8        /* voltage VCC = 3.3V */
#define MST_PCMCIA_PWR_VCC_50   0x4        /* voltage VCC = 5.0V */

This follows the Cirrus code (also used by Lubbock.)  So, if we represent
the MST_PCMCIA[01] registers as GPIOs, we can switch pxa2xx_mainstone.c
to use the max1600.c code for power control.

With the other signals in MST_PCMCIA[01] represented as GPIOs (we'd
need to add the VS* to soc_common), we'd then have those read by
generic code, which means mst_pcmcia_socket_state() becomes just the
hack for STSCHG.

With gpio-reg, we can represent these registers easily as GPIOs, eg:

	gc = gpio_reg_init(NULL, (void __iomem *)&MST_PCMCIA0,
			   -1, 11, "mst-pcmcia0", ~MST_PCMCIA_PWR_MASK, 0,
			   mst_pcmcia_names);

There is a slight issue, which is that the interrupts can't be
translated to an interrupt by gpio-reg, which will currently cause
soc_common problems - but that's an easy fix, though leaves us with
more code than I'd desire in pxa2xx_mainstone.c.  Maybe a solution
there would be to have gpio-reg also take an array of interrupt
numbers... not sure yet.


For IrDA, it looks like it has the same transceiver as the assabet, so
I've (already) patches to split out the gpio-based transceiver control
from sa1100_ir - maybe we can re-use that in pxaficp_ir too.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2016-08-31 10:27 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160829100232.GC1041@n2100.armlinux.org.uk>
2016-08-29 10:23 ` [RFC PATCH 00/33] SA11x0/PXA GPIO rework (Core + PCMCIA only) Russell King - ARM Linux
2016-08-29 10:24   ` [PATCH 01/33] gpio: sa1100: fix irq probing for ucb1x00 Russell King
2016-09-07 22:25     ` Linus Walleij
2016-08-29 10:24   ` [PATCH 02/33] gpio: sa1100: use sa11x0_gpio_set_wake() Russell King
2016-08-29 10:24   ` [PATCH 03/33] gpio: sa1100: convert to use IO accessors Russell King
2016-08-29 10:24   ` [PATCH 04/33] gpio: sa1100: implement get_direction method Russell King
2016-08-29 10:24   ` [PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver Russell King
2016-08-29 19:39     ` Robert Jarzmik
2016-08-29 23:12       ` Russell King - ARM Linux
2016-08-30  6:08         ` Alexander Shiyan
2016-08-30  7:41           ` Russell King - ARM Linux
2016-08-30  9:18       ` Russell King - ARM Linux
2016-08-30 16:42         ` Robert Jarzmik
2016-08-30 18:46           ` Russell King - ARM Linux
2016-08-30 21:32             ` Robert Jarzmik
2016-08-31  8:49               ` Russell King - ARM Linux
2016-08-31 10:27                 ` Russell King - ARM Linux [this message]
2016-09-01  7:19                   ` Robert Jarzmik
2016-09-01  9:27                     ` Russell King - ARM Linux
2016-09-01 21:58                       ` Robert Jarzmik
2016-09-01 23:02                         ` Russell King - ARM Linux
2016-09-02 17:50                           ` Robert Jarzmik
2016-09-02 18:56                             ` Russell King - ARM Linux
2016-09-02 21:21                               ` Robert Jarzmik
2016-09-02 23:34                                 ` Russell King - ARM Linux
2016-09-03  9:15                                 ` Russell King - ARM Linux
2016-09-03  9:09                     ` Russell King - ARM Linux
2016-09-03 10:25                 ` Russell King - ARM Linux
2016-09-03 11:31                   ` Robert Jarzmik
2016-09-04 19:04                   ` Robert Jarzmik
2016-09-04 20:18                     ` Russell King - ARM Linux
2016-09-05  9:06                 ` Linus Walleij
2016-09-05 12:26                   ` Russell King - ARM Linux
2016-09-08 13:21                     ` Linus Walleij
2016-09-14  8:50                       ` Linus Walleij
2016-08-30 21:25     ` Linus Walleij
2016-08-30 21:42       ` Russell King - ARM Linux
2016-08-30 21:47         ` Linus Walleij
2016-09-02 17:00           ` Russell King - ARM Linux
2016-09-04 20:53             ` Linus Walleij
2016-08-29 10:24   ` [PATCH 06/33] ARM: pxa/lubbock: add GPIO driver for LUB_MISC_WR register Russell King
2016-08-29 19:57     ` Robert Jarzmik
2016-08-29 22:58       ` Russell King - ARM Linux
2016-08-29 10:24   ` [PATCH 07/33] ARM: sa1100/assabet: add BCR/BSR GPIO driver Russell King
2016-08-29 10:24   ` [PATCH 08/33] ARM: sa1100/neponset: add GPIO drivers for control and modem registers Russell King
2016-08-29 10:24   ` [PATCH 09/33] ARM: sa1111: implement a gpio_chip for SA1111 GPIOs Russell King
2016-08-29 10:24   ` [PATCH 10/33] pcmcia: soc_common: switch to using gpio_descs Russell King
2016-09-14 11:29     ` Linus Walleij
2016-09-14 12:10       ` Russell King - ARM Linux
2016-08-29 10:25   ` [PATCH 11/33] pcmcia: soc_common: request legacy detect GPIO with active low Russell King
2016-08-29 10:25   ` [PATCH 12/33] pcmcia: soc_common: add support for reset and bus enable GPIOs Russell King
2016-08-29 10:25   ` [PATCH 13/33] pcmcia: soc_common: restore previous socket state on error Russell King
2016-08-29 10:25   ` [PATCH 14/33] pcmcia: soc_common: add CF socket state helper Russell King
2016-08-29 10:25   ` [PATCH 15/33] pcmcia: soc_common: add support for Vcc and Vpp regulators Russell King
2016-08-29 10:25   ` [PATCH 16/33] pcmcia: soc_common: switch to a per-socket cpufreq notifier Russell King
2016-08-29 10:25   ` [PATCH 17/33] pcmcia: soc_common: constify pcmcia_low_level ops pointer Russell King
2016-08-29 10:25   ` [PATCH 18/33] pcmcia: sa1100: provide generic CF support Russell King
2016-09-14  8:52     ` Linus Walleij
2016-09-14  9:06       ` Russell King - ARM Linux
2016-09-14 11:13         ` Linus Walleij
2016-08-29 10:25   ` [PATCH 19/33] pcmcia: sa1111: add driver-data pointer Russell King
2016-08-29 10:25   ` [PATCH 20/33] pcmcia: add MAX1600 driver Russell King
2016-08-29 10:25   ` [PATCH 21/33] ARM: sa1100: provide infrastructure to support generic CF sockets Russell King
2016-08-29 10:25   ` [PATCH 22/33] ARM: sa1100/assabet: convert to " Russell King
2016-08-29 10:26   ` [PATCH 23/33] ARM: sa1100/cerf: " Russell King
2016-08-29 10:26   ` [PATCH 24/33] ARM: sa1100/h3xxx: switch h3xxx PCMCIA to use gpiod APIs Russell King
2016-08-29 10:26   ` [PATCH 25/33] ARM: sa1100/nanoengine: convert to generic CF sockets Russell King
2016-08-29 10:26   ` [PATCH 26/33] ARM: sa1100/shannon: switch shannon PCMCIA to use gpiod APIs Russell King
2016-08-29 10:26   ` [PATCH 27/33] ARM: sa1100/simpad: switch simpad CF " Russell King
2016-08-29 10:26   ` [PATCH 28/33] ARM: sa1100/neponset: add GPIOs for PCMCIA Russell King
2016-08-29 10:26   ` [PATCH 29/33] pcmcia: sa1111/neponset: convert to use MAX1600 power driver Russell King
2016-08-29 10:26   ` [PATCH 30/33] ARM: sa1100/jornada720: switch jornada720 PCMCIA to gpiod APIs Russell King
2016-08-29 10:26   ` [PATCH 31/33] ARM: pxa/lubbock: convert PCMCIA to use MAX1600 driver Russell King
2016-08-29 10:26   ` [PATCH 32/33] pcmcia: sa1100*: remove redundant bvd1/bvd2 setting Russell King
2016-08-29 10:26   ` [PATCH 33/33] ARM: sa1111: remove legacy GPIO interfaces Russell King
2016-08-30 21:31   ` [RFC PATCH 00/33] SA11x0/PXA GPIO rework (Core + PCMCIA only) Linus Walleij
2016-09-01 15:34     ` Russell King - ARM Linux

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=20160831102721.GR1041@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=daniel@zonque.org \
    --cc=gnurou@gmail.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=kristoffer.ericson@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    --cc=robert.jarzmik@free.fr \
    /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).