netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Helmut Buchsbaum <helmut.buchsbaum@gmail.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH 3/7] net: phy: spi_ks8995: add register initialization
Date: Sun, 7 Feb 2016 20:38:25 -0800	[thread overview]
Message-ID: <56B81BC1.6090904@gmail.com> (raw)
In-Reply-To: <1454884753-4560-4-git-send-email-helmut.buchsbaum@gmail.com>

On 07/02/2016 14:39, Helmut Buchsbaum wrote:
> Since several use cases need to setup at least some basic control
> registers add the ability to configure an array containing such
> register initialization values within the platform data of the switch.
> Furthermore expose this capabilty to the devicetree.
> 
> Platform data now contains a pointer to an array and the array length
> where each member contains the register to be initialized, the
> initialization value and a register mask, since in many use cases there
> is only the need to init some bits of a register, e.g. disabling unused
> ports.
> 
> The devicetree notation add the property 'settings' to the SPI node of the
> ks8985 driver, which is a list of triple values (register, value, mask),
> e.g.:
> 
> settings = <0x4D 0x08 0x08
>             0x5D 0x08 0x08>;

You encode way too much in the Device Tree that should be knowledge to
the driver on how to configure the switch. This is very tempting,
because you do not dictate any use case and let people define it based
on their Device Tree source, but at the same time, this is very error
prone and does not provide what a proper device driver needs to be doing
by defining a standard and predictable behavior.

Right now this driver is a PHY driver, but it should be moved to a DSA
driver eventually such that each port is exposed as a network interface,
and you have hooks to power on/off ports based on whether a
corresponding network interface is up/down.

  reply	other threads:[~2016-02-08  4:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-07 22:39 [PATCH 0/7] Add support for MICREL KSZ8795CLX 5-port switch Helmut Buchsbaum
2016-02-07 22:39 ` [PATCH 1/7] net: phy: spi_ks8995: introduce spi_device_id table Helmut Buchsbaum
2016-02-07 22:39 ` [PATCH 2/7] net: phy: spi_ks8995: verify chip and determine revision Helmut Buchsbaum
2016-02-07 22:39 ` [PATCH 3/7] net: phy: spi_ks8995: add register initialization Helmut Buchsbaum
2016-02-08  4:38   ` Florian Fainelli [this message]
2016-02-08  8:28     ` Helmut Buchsbaum
2016-02-08  8:54       ` Andrew Lunn
2016-02-07 22:39 ` [PATCH 4/7] net: phy: spi_ks8995: add support for resetting switch using GPIO Helmut Buchsbaum
2016-02-08  9:22   ` Andrew Lunn
2016-02-07 22:39 ` [PATCH 5/7] net: phy: spi_ks8995: generalize creation of SPI commands Helmut Buchsbaum
2016-02-07 22:39 ` [PATCH 6/7] net: phy: spi_ks8995: add support for MICREL KSZ8795CLX Helmut Buchsbaum
2016-02-07 22:39 ` [PATCH 7/7] dt-bindings: net: ks8995: add bindings documentation for ks8995 Helmut Buchsbaum

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=56B81BC1.6090904@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=helmut.buchsbaum@gmail.com \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).