All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Subject: [patch 4/9] i2c-s3c2410: use platform data for gpio configuration
Date: Fri, 31 Oct 2008 16:04:24 +0000	[thread overview]
Message-ID: <20081031160437.274275162@fluff.org.uk> (raw)
In-Reply-To: 20081031160420.164160051@fluff.org.uk

[-- Attachment #1: simtec/s3c64xx/i2c-remove-gpio-config.patch --]
[-- Type: text/plain, Size: 1501 bytes --]

Add a callback to set the gpio configuration for the
i2c device instead of a set include. This also allows
the remvoal of the machine gpio and hardware files.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

Index: linux.git/drivers/i2c/busses/i2c-s3c2410.c
===================================================================
--- linux.git.orig/drivers/i2c/busses/i2c-s3c2410.c	2008-10-31 11:55:50.000000000 +0000
+++ linux.git/drivers/i2c/busses/i2c-s3c2410.c	2008-10-31 11:55:54.000000000 +0000
@@ -36,10 +36,8 @@
 #include <linux/cpufreq.h>
 #include <linux/io.h>
 
-#include <mach/hardware.h>
 #include <asm/irq.h>
 
-#include <mach/regs-gpio.h>
 #include <plat/regs-iic.h>
 #include <plat/iic.h>
 
@@ -490,9 +488,6 @@ static int s3c24xx_i2c_set_master(struct
 		msleep(1);
 	}
 
-	dev_dbg(i2c->dev, "timeout: GPEDAT is %08x\n",
-		__raw_readl(S3C2410_GPEDAT));
-
 	return -ETIMEDOUT;
 }
 
@@ -784,12 +779,12 @@ static int s3c24xx_i2c_init(struct s3c24
 
 	/* get the plafrom data */
 
-	pdata = s3c24xx_i2c_get_platformdata(i2c->adap.dev.parent);
+	pdata = s3c24xx_i2c_get_platformdata(i2c->dev);
 
 	/* inititalise the gpio */
 
-	s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_IICSDA);
-	s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_IICSCL);
+	if (pdata->cfg_gpio)
+		pdata->cfg_gpio(to_platform_device(i2c->dev));
 
 	/* write slave address */
 

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

  parent reply	other threads:[~2008-10-31 16:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-31 16:04 [patch 0/9] I2C patches for S3C24XX Ben Dooks
2008-10-31 16:04 ` [patch 1/9] i2c-s3c2410: fix check for being in suspend Ben Dooks
2008-10-31 16:04 ` [patch 2/9] i2c-s3c2410: Use <linux/io.h> over <asm/io.h> Ben Dooks
2008-10-31 16:04 ` [patch 3/9] i2c-s3c2410: fixup style problems from checkpatch.pl Ben Dooks
2008-10-31 16:04 ` Ben Dooks [this message]
2008-10-31 16:04 ` [patch 5/9] i2c-s3c2410: Add ARCH_S3C64XX to allowed archs Ben Dooks
2008-10-31 16:04 ` [patch 6/9] i2c-s3c2410: remove default platform data Ben Dooks
2008-10-31 16:04 ` [patch 7/9] i2c-s3c2410: Allow more than one i2c-s3c2410 adapter Ben Dooks
2008-10-31 16:04 ` [patch 8/9] S3C: Add i2c1 device definition Ben Dooks
2008-10-31 16:04 ` [patch 9/9] i2c-s3c2410: change IRQ to be plain integer Ben Dooks

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=20081031160437.274275162@fluff.org.uk \
    --to=ben-linux-elnmno+kys3ytjvyw6ydsg@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@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.