From 6fb715de6a8a981f696953795fcfb8aff1742e03 Mon Sep 17 00:00:00 2001 From: Andrei Warkentin Date: Mon, 28 Jun 2010 17:59:01 -0500 Subject: [PATCH] w1: master: tegra_w1: Adds generic mach-tegra w1 support. This adds w1 as a device for mach-tegra boards, fixes wrong OWR I/O base, and changes OWR clock name. Change-Id: Idffbdbd05f383ce8e423ee301e197e230db4f2f9 Signed-off-by: Andrei Warkentin --- arch/arm/mach-tegra/devices.c | 21 ++++++++++++++++++++- arch/arm/mach-tegra/devices.h | 3 ++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c index 05d5f28dee4d..600b1b484efc 100644 --- a/arch/arm/mach-tegra/devices.c +++ b/arch/arm/mach-tegra/devices.c @@ -261,7 +261,6 @@ static struct resource sdhci_resource4[] = { }, }; - /* board files should fill in platform_data register the devices themselvs. * See board-harmony.c for an example */ @@ -292,3 +291,23 @@ struct platform_device tegra_sdhci_device4 = { .resource = sdhci_resource4, .num_resources = ARRAY_SIZE(sdhci_resource4), }; + +static struct resource w1_resources[] = { + [0] = { + .start = INT_OWR, + .end = INT_OWR, + .flags = IORESOURCE_IRQ + }, + [1] = { + .start = TEGRA_OWR_BASE, + .end = TEGRA_OWR_BASE + TEGRA_OWR_SIZE - 1, + .flags = IORESOURCE_MEM + } +}; + +struct platform_device tegra_w1_device = { + .name = "tegra_w1", + .id = -1, + .resource = w1_resources, + .num_resources = ARRAY_SIZE(w1_resources), +}; diff --git a/arch/arm/mach-tegra/devices.h b/arch/arm/mach-tegra/devices.h index 9539988f08af..bbe95926842d 100644 --- a/arch/arm/mach-tegra/devices.h +++ b/arch/arm/mach-tegra/devices.h @@ -1,5 +1,5 @@ /* - * arch/arm/mach-tegra/devices.c + * arch/arm/mach-tegra/devices.h * * Copyright (C) 2010 Google, Inc. * @@ -35,5 +35,6 @@ extern struct platform_device tegra_spi_device1; extern struct platform_device tegra_spi_device2; extern struct platform_device tegra_spi_device3; extern struct platform_device tegra_spi_device4; +extern struct platform_device tegra_w1_device; #endif -- 2.34.1