From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: sathyanarayanan kuppuswamy
<sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
Subject: Re: [PATCH v1 1/1] i2c: Add acpi support to enumerate i2c mux clients
Date: Wed, 3 Jun 2015 10:19:39 +0900 [thread overview]
Message-ID: <20150603011938.GA1548@katana> (raw)
In-Reply-To: <556E4C7C.8050009-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1716 bytes --]
On Tue, Jun 02, 2015 at 05:38:20PM -0700, sathyanarayanan kuppuswamy wrote:
> Hi Sang
>
> Thanks for your comments. Please find my reply inline.
>
> On 06/02/2015 09:19 AM, Wolfram Sang wrote:
> >>+#ifdef CONFIG_ACPI
> >>+static void acpi_i2c_mux_register_devices(struct i2c_adapter *adap,
> >>+ struct device *mux_dev)
> >>+{
> >>+ acpi_handle handle;
> >>+ acpi_status status;
> >>+
> >>+ handle = ACPI_HANDLE(mux_dev);
> >>+ if (!handle)
> >>+ return;
> >>+
> >>+ status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
> >>+ acpi_i2c_add_device, NULL,
> >>+ adap, NULL);
> >>+
> >>+ if (ACPI_FAILURE(status))
> >>+ dev_warn(mux_dev, "mux adapter slave enumeration fails\n");
> >>+}
> >>+#else /* !CONFIG_ACPI */
> >>+static inline void acpi_i2c_mux_register_devices(struct i2c_adapter *adap,
> >>+ struct device *mux_dev) { }
> >>+#endif /* CONFIG_ACPI */
> >IMO, this shares too much code with acpi_i2c_register_devices(). And it
> >pulls in ACPI into mux.c which is not really needed.
> Even though mux is a just a virtual adapter without any ACPI ID, Its slaves
> are a still actual devices and needs to be enumerated by ACPI. So think its
> accptable to include ACPI in mux code. Don't you agree ?
The resulting function should be called from mux code. But the function
itself should be in the core.
> Also ACPI handle code in this function is slightly different from
> acpi_i2c_register_devices() code.
The only difference I see is that one takes a device as parameter, the
other an adapter. So, you can read out the device from the adapter in
acpi_i2c_register_devices() and then call
acpi_i2c_register_devices_from_dev().
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-06-03 1:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-09 19:15 [PATCH v1 0/1] ACPI enumeration support for i2c mux clients Kuppuswamy Sathyanarayanan
[not found] ` <cover.1428546834.git.sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-04-09 19:15 ` [PATCH v1 1/1] i2c: Add acpi support to enumerate " Kuppuswamy Sathyanarayanan
[not found] ` <b57c66fc1b7e790bd8c3e525faf65ce46cd91f23.1428546834.git.sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-04-10 8:42 ` Mika Westerberg
[not found] ` <20150410084208.GR1734-3PARRvDOhMZrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2015-04-26 8:22 ` Sathyanarayanan Kuppuswamy
2015-04-29 23:38 ` sathyanarayanan kuppuswamy
2015-05-18 20:52 ` sathyanarayanan kuppuswamy
2015-06-02 16:19 ` Wolfram Sang
2015-06-03 0:38 ` sathyanarayanan kuppuswamy
[not found] ` <556E4C7C.8050009-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-06-03 1:19 ` Wolfram Sang [this message]
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=20150603011938.GA1548@katana \
--to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.