From: sathyanarayanan kuppuswamy <sathyanarayanan.kuppuswamy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@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: Tue, 02 Jun 2015 17:38:20 -0700 [thread overview]
Message-ID: <556E4C7C.8050009@linux.intel.com> (raw)
In-Reply-To: <20150602161953.GA12451@katana>
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 ?
Also ACPI handle code in this function is slightly different from
acpi_i2c_register_devices() code.
>
> What about naming the above function
> acpi_i2c_register_devices_from_dev() and let acpi_i2c_register_devices()
If you call this function from i2c-core register device function, then
how will you maintain the hierarchy ? We need some way to indicate that
these devices are under mux adapter right ?
> then call it as a helper function, all this in i2c-core.c?
>
> Thanks for your patience BTW...
>
--
Sathyanarayanan Kuppuswamy
Android kernel developer
next prev parent reply other threads:[~2015-06-03 0:38 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 [this message]
[not found] ` <556E4C7C.8050009-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-06-03 1:19 ` Wolfram Sang
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=556E4C7C.8050009@linux.intel.com \
--to=sathyanarayanan.kuppuswamy-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=srinivas.pandruvada-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@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.