aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/include/mach/w1.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra/include/mach/w1.h')
-rw-r--r--arch/arm/mach-tegra/include/mach/w1.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/w1.h b/arch/arm/mach-tegra/include/mach/w1.h
new file mode 100644
index 00000000000..c96df7abdf9
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/w1.h
@@ -0,0 +1,84 @@
1/*
2 * include/mach/w1.h
3 *
4 * Copyright (C) 2010 Motorola, Inc
5 * Author: Andrei Warkentin <andreiw@motorola.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17#ifndef __ASM_ARM_ARCH_TEGRA_W1_H
18#define __ASM_ARM_ARCH_TEGRA_W1_H
19
20struct tegra_w1_timings {
21
22 /* tsu, trelease, trdv, tlow0, tlow1 and tslot are formed
23 into the value written into OWR_RST_PRESENCE_TCTL_0 register. */
24
25 /* Read data setup, Tsu = N owr clks, Range = tsu < 1,
26 Typical value = 0x1 */
27 uint32_t tsu;
28
29 /* Release 1-wire time, Trelease = N owr clks,
30 Range = 0 <= trelease < 45, Typical value = 0xf */
31 uint32_t trelease;
32
33 /* Read data valid time, Trdv = N+1 owr clks, Range = Exactly 15 */
34 uint32_t trdv;
35
36 /* Write zero time low, Tlow0 = N+1 owr clks,
37 Range = 60 <= tlow0 < tslot < 120, typical value = 0x3c. */
38 uint32_t tlow0;
39
40 /* Write one time low, or TLOWR both are same Tlow1 = N+1 owr clks,
41 Range = 1 <= tlow1 < 15 TlowR = N+1 owr clks,
42 Range = 1 <= tlowR < 15, Typical value = 0x1. */
43 uint32_t tlow1;
44
45 /* Active time slot for write or read data, Tslot = N+1 owr clks,
46 Range = 60 <= tslot < 120, Typical value = 0x77. */
47 uint32_t tslot;
48
49 /* tpdl, tpdh, trstl, trsth are formed in the the value written
50 into the OWR_RST_PRESENCE_TCTL_0 register. */
51
52 /* Tpdl = N owr clks, Range = 60 <= tpdl < 240,
53 Typical value = 0x78. */
54 uint32_t tpdl;
55
56 /* Tpdh = N+1 owr clks, Range = 15 <= tpdh < 60.
57 Typical value = 0x1e. */
58 uint32_t tpdh;
59
60 /* Trstl = N+1 owr clks, Range = 480 <= trstl < infinity,
61 Typical value = 0x1df. */
62 uint32_t trstl;
63
64 /* Trsth = N+1 owr clks, Range = 480 <= trsth < infinity,
65 Typical value = 0x1df. */
66 uint32_t trsth;
67
68 /* Read data sample clock. Should be <= to (tlow1 - 6) clks,
69 6 clks are used for deglitch. If deglitch bypassed it
70 is 3 clks, Typical value = 0x7. */
71 uint32_t rdsclk;
72
73 /* Presence sample clock. Should be <= to (tpdl - 6) clks,
74 6 clks are used for deglitch. If deglitch bypassed it is 3 clks,
75 Typical value = 0x50. */
76 uint32_t psclk;
77};
78
79struct tegra_w1_platform_data {
80 const char *clk_id;
81 struct tegra_w1_timings *timings;
82};
83
84#endif