linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org,
	linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org,
	Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Subject: [patch 1/4] SPI: Add pin configuration callback
Date: Sun, 12 Oct 2008 16:36:03 +0100	[thread overview]
Message-ID: <20081012153725.883171112@fluff.org.uk> (raw)
In-Reply-To: 20081012153602.964236456@fluff.org.uk

[-- Attachment #1: simtec/simtec-drivers-spi-s3c24xx-gpiosetup.patch --]
[-- Type: text/plain, Size: 2449 bytes --]

Add a gpio configuration callback for the s3c24xx SPI driver, as
there are several options depending on the channel and the chip
in use.

This is needed as the controller may not have been setup by the
initial bootloader and the fact that the SPI controller gets
reset over suspend/resume into slave mode but the GPIO function
registers do not.

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

Index: linux-2.6.27-rc1-quilt1/drivers/spi/spi_s3c24xx.c
===================================================================
--- linux-2.6.27-rc1-quilt1.orig/drivers/spi/spi_s3c24xx.c	2008-08-04 11:46:12.000000000 +0100
+++ linux-2.6.27-rc1-quilt1/drivers/spi/spi_s3c24xx.c	2008-08-04 11:46:54.000000000 +0100
@@ -247,6 +247,9 @@ static void s3c24xx_spi_initialsetup(str
 	writeb(0xff, hw->regs + S3C2410_SPPRE);
 	writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
 	writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
+
+	if (hw->pdata && hw->pdata->gpio_setup)
+		hw->pdata->gpio_setup(hw->pdata, 1);
 }
 
 static int __init s3c24xx_spi_probe(struct platform_device *pdev)
@@ -412,6 +415,9 @@ static int s3c24xx_spi_suspend(struct pl
 {
 	struct s3c24xx_spi *hw = platform_get_drvdata(pdev);
 
+	if (hw->pdata && hw->pdata->gpio_setup)
+		hw->pdata->gpio_setup(hw->pdata, 0);
+
 	clk_disable(hw->clk);
 	return 0;
 }
Index: linux-2.6.27-rc1-quilt1/arch/arm/mach-s3c2410/include/mach/spi.h
===================================================================
--- linux-2.6.27-rc1-quilt1.orig/arch/arm/mach-s3c2410/include/mach/spi.h	2008-08-04 11:45:55.000000000 +0100
+++ linux-2.6.27-rc1-quilt1/arch/arm/mach-s3c2410/include/mach/spi.h	2008-08-04 11:46:13.000000000 +0100
@@ -18,6 +18,7 @@ struct s3c2410_spi_info {
 	unsigned int		 num_cs;	/* total chipselects */
 	int			 bus_num;       /* bus number to use. */
 
+	void (*gpio_setup)(struct s3c2410_spi_info *spi, int enable);
 	void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol);
 };
 

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

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

  reply	other threads:[~2008-10-12 15:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-12 15:36 [patch 0/4] S3C24XX updates for 2.6.28 (v3) Ben Dooks
2008-10-12 15:36 ` Ben Dooks [this message]
2008-10-12 15:36 ` [patch 2/4] spi_s3c24xx_gpio: fix spi-device to our private data lookup Ben Dooks
2008-10-12 15:36 ` [patch 3/4] spi_s3c24xx_gpio: fix setting of num_chipselect Ben Dooks
2008-10-12 15:36 ` [patch 4/4] spi_s3c2410: use generic gpio calls instead of arch specific ones Ben Dooks
  -- strict thread matches above, loose matches on Subject: below --
2008-10-10 10:04 [patch 0/4] S3C24XX SPI updates for 2.6.27 (correct set) Ben Dooks
2008-10-10 10:04 ` [patch 1/4] SPI: Add pin configuration callback 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=20081012153725.883171112@fluff.org.uk \
    --to=ben-linux-elnmno+kys3ytjvyw6ydsg@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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).