From: <ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org,
plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org,
n.voss-+umVssTZoCsb1SvskN2V4Q@public.gmane.org,
w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
Ludovic Desroches
<ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH v2 4/8] ARM: at91: do not configure at91sam9g10 twi pio as open-drain
Date: Mon, 3 Sep 2012 12:16:03 +0200 [thread overview]
Message-ID: <1346667367-7969-5-git-send-email-ludovic.desroches@atmel.com> (raw)
In-Reply-To: <1346667367-7969-1-git-send-email-ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
From: Ludovic Desroches <ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
As indicated in the datasheet, TWD and TWCK must not be programmed as
open-drain.
Signed-off-by: Ludovic Desroches <ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Acked-by: Nikolaus Voss <n.voss-+umVssTZoCsb1SvskN2V4Q@public.gmane.org>
Acked-by: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
---
arch/arm/mach-at91/at91sam9261_devices.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index fdb5675..991a7e4 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -324,20 +324,22 @@ static struct platform_device at91sam9261_twi_device = {
void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
{
- /* IP version is not the same on 9261 and g10 */
+ /*
+ * IP version is not the same on 9261 and g10 and only 9261 one
+ * requires to configure PIO as open-drain.
+ */
if (cpu_is_at91sam9g10()) {
at91sam9261_twi_device.name = "i2c-at91sam9g10";
+ at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */
+ at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */
} else {
at91sam9261_twi_device.name = "i2c-at91sam9261";
+ at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */
+ at91_set_multi_drive(AT91_PIN_PA7, 1);
+ at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */
+ at91_set_multi_drive(AT91_PIN_PA8, 1);
}
- /* pins used for TWI interface */
- at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */
- at91_set_multi_drive(AT91_PIN_PA7, 1);
-
- at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */
- at91_set_multi_drive(AT91_PIN_PA8, 1);
-
i2c_register_board_info(0, devices, nr_devices);
platform_device_register(&at91sam9261_twi_device);
}
--
1.7.11.3
next prev parent reply other threads:[~2012-09-03 10:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-03 10:15 [PATCH v2 0/8] i2c: at91: cleanup and dt support ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w
[not found] ` <1346667367-7969-1-git-send-email-ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2012-09-03 10:16 ` [PATCH v2 1/8] i2c: at91: use managed resources ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w
2012-09-03 10:16 ` [PATCH v2 2/8] i2c: at91: add warning about transmission issues for some devices ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w
2012-09-03 10:16 ` [PATCH v2 3/8] i2c: at91: use an id table for SoC dependent parameters ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w
2012-09-03 10:16 ` ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w [this message]
2012-09-03 10:18 ` [PATCH v2 5/8] i2c: at91: add dt support to i2c-at91 ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w
2012-09-03 10:19 ` [PATCH v2 6/8] ARM: at91: add clocks for I2C DT entries ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w
2012-09-03 10:19 ` [PATCH v2 7/8] ARM: dts: add twi nodes for atmel SoCs ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w
2012-09-03 10:20 ` [PATCH v2 8/8] ARM: dts: add twi nodes for atmel boards ludovic.desroches-AIFe0yeh4nAAvxtiuMwx3w
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=1346667367-7969-5-git-send-email-ludovic.desroches@atmel.com \
--to=ludovic.desroches-aife0yeh4naavxtiumwx3w@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=n.voss-+umVssTZoCsb1SvskN2V4Q@public.gmane.org \
--cc=nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
--cc=plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@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 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).