From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 08/12] i2c: s3c: Implant support for S3C2440
Date: Tue, 22 Jul 2014 02:34:49 +0200 [thread overview]
Message-ID: <1405989293-6629-8-git-send-email-marex@denx.de> (raw)
In-Reply-To: <1405989293-6629-1-git-send-email-marex@denx.de>
This is a matter of simple additional ifdefery to cater
for the different register layout of the S3C2440 chip.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Vladimir Zapolskiy <vz@mleia.com>
---
drivers/i2c/s3c24x0_i2c.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
index fd328f0..927cf61 100644
--- a/drivers/i2c/s3c24x0_i2c.c
+++ b/drivers/i2c/s3c24x0_i2c.c
@@ -153,7 +153,7 @@ static int GetI2CSDA(void)
{
struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio();
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
return (readl(&gpio->gpedat) & 0x8000) >> 15;
#endif
#ifdef CONFIG_S3C2400
@@ -165,7 +165,7 @@ static void SetI2CSCL(int x)
{
struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio();
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
writel((readl(&gpio->gpedat) & ~0x4000) |
(x & 1) << 14, &gpio->gpedat);
#endif
@@ -427,7 +427,7 @@ static void s3c24x0_i2c_init(struct i2c_adapter *adap, int speed, int slaveadd)
int i;
if ((readl(&i2c->iicstat) & I2CSTAT_BSY) || GetI2CSDA() == 0) {
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
ulong old_gpecon = readl(&gpio->gpecon);
#endif
#ifdef CONFIG_S3C2400
@@ -436,7 +436,7 @@ static void s3c24x0_i2c_init(struct i2c_adapter *adap, int speed, int slaveadd)
/* bus still busy probably by (most) previously interrupted
transfer */
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
/* set I2CSDA and I2CSCL (GPE15, GPE14) to GPIO */
writel((readl(&gpio->gpecon) & ~0xF0000000) | 0x10000000,
&gpio->gpecon);
@@ -462,7 +462,7 @@ static void s3c24x0_i2c_init(struct i2c_adapter *adap, int speed, int slaveadd)
udelay(1000);
/* restore pin functions */
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
writel(old_gpecon, &gpio->gpecon);
#endif
#ifdef CONFIG_S3C2400
--
2.0.0.rc2
next prev parent reply other threads:[~2014-07-22 0:34 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 0:34 [U-Boot] [PATCH 01/12] video: Add S3C24xx framebuffer support Marek Vasut
2014-07-22 0:34 ` [U-Boot] [PATCH 02/12] arm: s3c24xx: Fix incorrect CONFIG_SYS_S3C2410_NAND_HWECC name Marek Vasut
2014-07-22 0:34 ` [U-Boot] [PATCH 03/12] mtd: nand: s3c: Fix data type width in debug() Marek Vasut
2014-07-28 23:35 ` Scott Wood
2014-07-29 0:09 ` Marek Vasut
2014-07-29 0:12 ` Scott Wood
2014-07-29 1:11 ` Marek Vasut
2014-07-29 1:22 ` Scott Wood
2014-07-29 4:21 ` Marek Vasut
2014-07-22 0:34 ` [U-Boot] [PATCH 04/12] mtd: nand: s3c: Unify the register definition and naming Marek Vasut
2014-07-22 0:34 ` [U-Boot] [PATCH 05/12] mtd: nand: s3c: Add S3C2440 specifics Marek Vasut
2014-07-22 0:34 ` [U-Boot] [PATCH 06/12] mtd: nand: s3c: Add S3C2440 buffer reading Marek Vasut
2014-07-22 0:34 ` [U-Boot] [PATCH 07/12] mtd: nand: s3c: Add missing correction and select_chip functions Marek Vasut
2014-07-22 0:34 ` Marek Vasut [this message]
2014-07-22 0:34 ` [U-Boot] [PATCH 09/12] gpio: s3c: Fix the GPIO driver Marek Vasut
2014-07-22 0:34 ` [U-Boot] [PATCH 10/12] arm: s3c: Unify the S3C24xx SDI structure Marek Vasut
2014-07-22 0:34 ` [U-Boot] [PATCH 11/12] mmc: s3c: Add SD driver Marek Vasut
2014-08-01 16:25 ` Pantelis Antoniou
2014-08-01 16:26 ` Pantelis Antoniou
2014-07-22 0:34 ` [U-Boot] [PATCH 12/12] net: smc911x: Keep MAC programmed Marek Vasut
2014-07-22 20:43 ` Joe Hershberger
2014-07-22 9:25 ` [U-Boot] [PATCH 01/12] video: Add S3C24xx framebuffer support Wolfgang Denk
2014-07-23 3:00 ` Marek Vasut
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=1405989293-6629-8-git-send-email-marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.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