linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Lee Jones <lee.jones@linaro.org>
Cc: Benson Leung <bleung@chromium.org>,
	Gwendal Grignou <gwendal@chromium.org>,
	Guenter Roeck <groeck@google.com>,
	lkml <linux-kernel@vger.kernel.org>,
	thierry.escande@linaro.org,
	Gwendal Grignou <gwendal@chromium.org>
Subject: Re: [PATCH v2 2/2] cros_ec: Move cros_ec_dev module to drivers/mfd
Date: Thu, 21 Jun 2018 10:42:48 +0200	[thread overview]
Message-ID: <bb1bc51a-3ff9-a885-7037-55306d1af564@collabora.com> (raw)
In-Reply-To: <CAKdAkRRtv41c-s7vunaBde9Oj8L5b5YdfHcOFEueGYenHV=byg@mail.gmail.com>

Hi Dmitry,

I think I can answer some of your questions (not all).

cc'ing the new Thierry's address and Gwendal.

On 21/06/18 01:05, Dmitry Torokhov wrote:
> On Mon, Nov 20, 2017 at 8:18 AM Thierry Escande
> <thierry.escande@collabora.com> wrote:
>>
>> The cros_ec_dev module is responsible for registering the MFD devices
>> attached to the ChromeOS EC. This patch moves this module to drivers/mfd
>> so calls to mfd_add_devices() are not done from outside the MFD subtree
>> anymore.
> 
> I am quite a bit late to the party, but what's the rationale for not
> using mfd_add_devices() from outside of MFD tree? We do allow
> registering i2c clients from outside of i2c core, and spi from outside
> of spi core, etc, etc.
> 

What I can say here is that when I tried to use mfd_add_devices outside the mfd
Lee has the preference to not to do this. That's the main reason why we moved
cros_ec_dev to mfd subsystem. The origin of this discussion started here [1] and
iirc after talk with Lee via irc he was not agree to use mfd_add_devices outside
the mfd subsystem (Lee correct me if I am wrong). So, is Lee who can add the
reasoning here.

[1] https://www.spinics.net/lists/kernel/msg2465099.html

> Right now I see cros_ec being split, quite haphazardly, between
> drivers/platform/chrome and drivers/mfd, with some transport drivers
> (i2C, SPI) and some interfaces living in MFD, while LPC transport and
> host of other stuff living in drivers/platform. On top of that we have
> cros_ec_keyb in input, RTC drivers, CEC, and god knows what else
> spread across various subsystems:
> 

Move the transport driver to platform/chrome is on my TODO, I didn't send the
patches to upstream yet, sorry about that.

About having the driver spread across various subsystem I don't have a hard
opinion. I suppose that this is because is the common way for mfd cells,
although, in this case, it is true that the drivers are very ChromeOS specific,
so maybe has sense have all in platform/chrome. On the other side, if you put
all in platform/chrome you will probably lost the advantage of have the
maintainer of the subsytem reviewing the patches (just because he filters the
drivers that doesn't go their subsystem).

> dtor@dtor-ws:~/kernel/linus $ find -name 'cros_ec*.c'
> ./drivers/iio/light/cros_ec_light_prox.c
> ./drivers/iio/accel/cros_ec_accel_legacy.c
> ./drivers/iio/pressure/cros_ec_baro.c
> ./drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> ./drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
> ./drivers/mfd/cros_ec_spi.c
> ./drivers/mfd/cros_ec.c
> ./drivers/mfd/cros_ec_i2c.c
> ./drivers/mfd/cros_ec_dev.c
> ./drivers/input/keyboard/cros_ec_keyb.c
> ./drivers/platform/chrome/cros_ec_vbc.c
> ./drivers/platform/chrome/cros_ec_debugfs.c
> ./drivers/platform/chrome/cros_ec_lpc.c
> ./drivers/platform/chrome/cros_ec_lightbar.c
> ./drivers/platform/chrome/cros_ec_lpc_reg.c
> ./drivers/platform/chrome/cros_ec_proto.c
> ./drivers/platform/chrome/cros_ec_lpc_mec.c
> ./drivers/platform/chrome/cros_ec_sysfs.c
> 
> The fact that sysfs/debugfs code is in platform but we instantiate it
> from MFD is pure madness (it's driver private data, there is no reason
> why it should be exported to nclude/linux/mfd/cros_ec.h). This all
> creates unnecessary friction and I would love to move most of the code
> into drivers/platform/chrome.
> 

Ack.

> I see the wisdom of having code that could potentially be used in
> several systems in respective subsystems code (pretty much majority of
> drivers/mfd/ drivers are for chips/IP blocks that are used and reused
> by different systems and boards), but I think cros ec is quite
> different in that regard as it is only used by ChromeOS devices and
> has little to no chance to be useful anywhere else.
> 
> Thanks.
> 

Cheers,
 Enric

  reply	other threads:[~2018-06-21  8:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20 16:15 [PATCH v2 0/2] mfd: cros_ec: move cros_ec_dev driver to MFD subdir Thierry Escande
2017-11-20 16:15 ` [PATCH v2 1/2] cros_ec: Split cros_ec_devs module Thierry Escande
2017-11-29 11:34   ` Lee Jones
2017-11-30 20:49   ` Guenter Roeck
2017-12-01 19:24     ` Gwendal Grignou
2017-11-20 16:15 ` [PATCH v2 2/2] cros_ec: Move cros_ec_dev module to drivers/mfd Thierry Escande
2017-11-29 11:35   ` Lee Jones
2017-11-30 20:50   ` Guenter Roeck
2017-12-01 19:23     ` Gwendal Grignou
2017-12-04  9:10       ` Lee Jones
2018-06-20 23:05   ` Dmitry Torokhov
2018-06-21  8:42     ` Enric Balletbo i Serra [this message]
2018-07-03  9:03     ` Lee Jones
2017-12-15 10:48 ` [GIT PULL] Immutable branch between MFD and Platform due for the v4.16 merge window Lee Jones
2017-12-16  4:50   ` Benson Leung

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=bb1bc51a-3ff9-a885-7037-55306d1af564@collabora.com \
    --to=enric.balletbo@collabora.com \
    --cc=bleung@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=groeck@google.com \
    --cc=gwendal@chromium.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.escande@linaro.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).