From: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
To: Loc Ho <lho@apm.com>,
wsa@the-dreams.de, Ken.Xue@amd.com, Jeff.Wu@amd.com,
rjw@rjwysocki.net, mika.westerberg@linux.intel.com,
lenb@kernel.org
Cc: linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, jcm@redhat.com,
patches@apm.com, "Hurwitz, Sherry" <sherry.hurwitz@amd.com>,
"Duran, Leo" <leo.duran@amd.com>,
Hanjun Guo <hanjun.guo@linaro.org>,
Al Stone <al.stone@linaro.org>
Subject: Re: [PATCH v2 0/2] i2c:dw: Add APM X-Gene ACPI I2C device support
Date: Mon, 14 Dec 2015 18:53:25 -0600 [thread overview]
Message-ID: <566F6485.2000508@amd.com> (raw)
In-Reply-To: <1449782357-22982-1-git-send-email-lho@apm.com>
Hi,
I'm not sure if this has been discussed earlier. But after looking at
the the acpi_apd driver, all we need is just the platform-specific input
clock frequency value used by the
drivers/i2c/busses/i2c-designware-core.c: i2c_dw_init() to calculate the
values to program into the DW_IC_SS_SCL_HCNT and DW_IC_SS_SCL_LCNT
registers.
So, instead of hard-coding this value into the driver/acpi/acpi_apd.c
(which really has nothing to do with the I2C driver), what if we
introduce a new ACPI key-value pair in the ACPI DSDT such as:
Device(I2C0) // I2C controller
{
Name(_HID, "AMDI0510")
Name(_UID, 0)
Name(_CRS, ResourceTemplate() {
Memory32Fixed (ReadWrite, 0xE1000000, 0x1000)
Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive,,,) {
389 } // GSIV
})
Name (_DSD, Package () {
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package () {
Package (2) {"clock-source-frequency", 100000000 }
}
}) // _DSD()
}
Then, in the drivers/i2c/busses/i2c-designware-platdrv.c, we can add the
code to parse this information. This way, the I2C driver can just
retrieve this value from the ACPI table of each platform, which should
make it easier to manage. Eventually, we can free I2C driver from the
driver/acpi/acpi_apd.c, which is currently only used by AMD x86 platform.
Also, this approach would allow the I2C drivers in other OSes to use
this same information in the ACPI table. If this approach is okay, I can
provide a patch to implement this.
Thanks,
Suravee
On 12/10/2015 3:19 PM, Loc Ho wrote:
> Add APM X-Gene ACPI I2C device support. These patches follow
> the same implementation as AMD I2C driver - changes in ACPI APD
> and Designware I2C drivers.
>
> v2:
> * Spilt the acpi_apd change with defines for AMD and X-Gene I2C's
>
> Signed-off-by: Loc Ho <lho@apm.com>
> ---
> Loc Ho (2):
> acpi:apd: Add APM X-Gene ACPI I2C device support
> i2c:dw: Add APM X-Gene ACPI I2C device support
>
> drivers/acpi/acpi_apd.c | 16 +++++++++++++++-
> drivers/i2c/busses/i2c-designware-platdrv.c | 1 +
> 2 files changed, 16 insertions(+), 1 deletions(-)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2015-12-15 0:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 21:19 [PATCH v2 0/2] i2c:dw: Add APM X-Gene ACPI I2C device support Loc Ho
2015-12-10 21:19 ` [PATCH v2 1/2] acpi:apd: " Loc Ho
2015-12-11 1:13 ` Ken Xue
2015-12-10 21:19 ` [PATCH v2 2/2] i2c:dw: " Loc Ho
2015-12-15 0:53 ` Suravee Suthikulanit [this message]
2015-12-15 13:27 ` [PATCH v2 0/2] " Mika Westerberg
2015-12-15 14:52 ` Suravee Suthikulpanit
2015-12-15 14:59 ` Mika Westerberg
2015-12-15 19:20 ` Loc Ho
2015-12-16 9:04 ` Mika Westerberg
2015-12-16 12:53 ` Jarkko Nikula
2015-12-23 9:34 ` Ken Xue
2015-12-23 9:52 ` Mika Westerberg
2015-12-23 9:59 ` Ken Xue
2015-12-23 10:17 ` Mika Westerberg
2015-12-23 10:02 ` Zheng, Ivan
2015-12-23 10:09 ` Mika Westerberg
2015-12-23 11:24 ` Zheng, Ivan
2015-12-23 11:40 ` Mika Westerberg
2016-01-04 9:09 ` Ben Dooks
2016-01-03 0:54 ` Rafael J. Wysocki
2016-01-04 6:23 ` Loc Ho
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=566F6485.2000508@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=Jeff.Wu@amd.com \
--cc=Ken.Xue@amd.com \
--cc=al.stone@linaro.org \
--cc=hanjun.guo@linaro.org \
--cc=jcm@redhat.com \
--cc=lenb@kernel.org \
--cc=leo.duran@amd.com \
--cc=lho@apm.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=patches@apm.com \
--cc=rjw@rjwysocki.net \
--cc=sherry.hurwitz@amd.com \
--cc=wsa@the-dreams.de \
/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).