netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Sander Vanheule <sander@svanheule.net>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-gpio@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	bert@biot.com
Subject: Re: [RFC PATCH 0/2] MIIM regmap and RTL8231 GPIO expander support
Date: Fri, 9 Apr 2021 22:10:38 +0200	[thread overview]
Message-ID: <YHC0vh/4O5Zm9+vO@lunn.ch> (raw)
In-Reply-To: <d73a44809c96abd0397474c63219a41e28f78235.camel@svanheule.net>

On Fri, Apr 09, 2021 at 07:42:32AM +0200, Sander Vanheule wrote:
> Hi Andrew,
> 
> Thank you for the feedback. You can find a (leaked) datasheet at:
> https://github.com/libc0607/Realtek_switch_hacking/blob/files/RTL8231_Datasheet_1.2.pdf

So this is not really an MFD. It has different ways of making use of
pins, which could be used for GPIO, but can also be used for LEDs. You
could look if it better fits in drivers/leds. But you can also use
GPIO drivers for LEDs via led-gpio.

> > I don't understand this split. Why not
> > 
> >      mdio-bus {
> >          compatible = "vendor,mdio";
> >          ...
> >  
> >          expander0: expander@0 {
> >              /*
> >               * Provide compatible for working registration of mdio
> > device.
> >               * Device probing happens in gpio1 node.
> >               */
> >              compatible = "realtek,rtl8231-expander";
> >              reg = <0>;
> >              gpio-controller;
> >          };
> >      };
> > 
> > You can list whatever properties you need in the node. Ethernet
> > switches have interrupt-controller, embedded MDIO busses with PHYs on
> > them etc.
> 
> This is what I tried initially, but it doesn't seem to work. The node
> is probably still added as an MDIO device, but rtl8231_gpio_probe()
> doesn't appear to get called at all. I do agree it would be preferable
> over the split specification.

Look at drivers/net/dsa/mv88e6xxx/chip.c for how to register an mdio
driver. If you still cannot get it to work, post your code and i will
take a look.

     Andrew

  reply	other threads:[~2021-04-09 20:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 20:52 [RFC PATCH 0/2] MIIM regmap and RTL8231 GPIO expander support Sander Vanheule
2021-04-08 20:52 ` [RFC PATCH 1/2] regmap: add miim bus support Sander Vanheule
2021-04-09 16:07   ` Mark Brown
2021-04-09 18:14     ` Sander Vanheule
2021-04-09 18:16       ` Mark Brown
2021-04-09 19:44         ` Andrew Lunn
2021-04-08 20:52 ` [RFC PATCH 2/2] gpio: Add Realtek RTL8231 support Sander Vanheule
2021-04-08 22:18 ` [RFC PATCH 0/2] MIIM regmap and RTL8231 GPIO expander support Andrew Lunn
2021-04-09  5:42   ` Sander Vanheule
2021-04-09 20:10     ` Andrew Lunn [this message]
2021-04-16 12:01       ` Sander Vanheule

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=YHC0vh/4O5Zm9+vO@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=bert@biot.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sander@svanheule.net \
    /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).