mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/4] at91sam9x5ek: add 1-wire support
Date: Wed, 31 Oct 2012 19:22:01 +0100	[thread overview]
Message-ID: <1351707724-28704-1-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20121031165240.GG29599@game.jcrosoft.org>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9x5ek/init.c     |   14 ++++++++++++++
 arch/arm/configs/at91sam9x5ek_defconfig |    4 ++++
 2 files changed, 18 insertions(+)

diff --git a/arch/arm/boards/at91sam9x5ek/init.c b/arch/arm/boards/at91sam9x5ek/init.c
index 58c945c..471169e 100644
--- a/arch/arm/boards/at91sam9x5ek/init.c
+++ b/arch/arm/boards/at91sam9x5ek/init.c
@@ -38,6 +38,12 @@
 #include <mach/at91_rstc.h>
 #include <gpio_keys.h>
 #include <readkey.h>
+#include <linux/w1-gpio.h>
+
+struct w1_gpio_platform_data w1_pdata = {
+	.pin = AT91_PIN_PB18,
+	.is_open_drain = 0,
+};
 
 static struct atmel_nand_data nand_pdata = {
 	.ale		= 21,
@@ -130,8 +136,16 @@ static int at91sam9x5ek_mem_init(void)
 }
 mem_initcall(at91sam9x5ek_mem_init);
 
+static void ek_add_device_w1(void)
+{
+	at91_set_gpio_input(w1_pdata.pin, 0);
+	at91_set_multi_drive(w1_pdata.pin, 1);
+	add_generic_device_res("w1-gpio", DEVICE_ID_SINGLE, NULL, 0, &w1_pdata);
+}
+
 static int at91sam9x5ek_devices_init(void)
 {
+	ek_add_device_w1();
 	ek_add_device_nand();
 	at91_add_device_eth(0, &macb_pdata);
 	at91_add_device_usbh_ohci(&ek_usbh_data);
diff --git a/arch/arm/configs/at91sam9x5ek_defconfig b/arch/arm/configs/at91sam9x5ek_defconfig
index cda360d..6315d9f 100644
--- a/arch/arm/configs/at91sam9x5ek_defconfig
+++ b/arch/arm/configs/at91sam9x5ek_defconfig
@@ -65,6 +65,10 @@ CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_LED_TRIGGERS=y
 CONFIG_KEYBOARD_GPIO=y
+CONFIG_W1=y
+CONFIG_W1_MASTER_GPIO=y
+CONFIG_W1_SLAVE_DS2431=y
+CONFIG_W1_SLAVE_DS2433=y
 CONFIG_FS_FAT=y
 CONFIG_FS_FAT_WRITE=y
 CONFIG_FS_FAT_LFN=y
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-10-31 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 16:52 [PATCH 0/4] at91sam9x5ek: add 1-wire support and hardware detection support Jean-Christophe PLAGNIOL-VILLARD
2012-10-31 18:22 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-10-31 18:22   ` [PATCH 2/4] at91sam9x5ek: add hw " Jean-Christophe PLAGNIOL-VILLARD
2012-10-31 18:22   ` [PATCH 3/4] at91sam9x5ek: add fixup for cogent cpu module Jean-Christophe PLAGNIOL-VILLARD
2012-10-31 18:22   ` [PATCH 4/4] at91sam9x5ek: use w1 serial number to generate local mac address Jean-Christophe PLAGNIOL-VILLARD
2012-11-01 15:30 ` [PATCH 0/4] at91sam9x5ek: add 1-wire support and hardware detection support Sascha Hauer

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=1351707724-28704-1-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.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