]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux/openslug-kernel-2.6.7/x1205-rtc.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux / openslug-kernel-2.6.7 / x1205-rtc.patch
1 --- drivers/i2c/chips/Kconfig.orig      2004-06-16 01:19:35.000000000 -0400
2 +++ drivers/i2c/chips/Kconfig   2004-09-22 18:09:48.454794342 -0400
3 @@ -240,6 +240,16 @@
4           This driver can also be built as a module.  If so, the module
5           will be called pcf8591.
6  
7 +config SENSORS_X1205
8 +       tristate "Xicor X1205 RTC chip"
9 +       depends on I2C && EXPERIMENTAL
10 +       select I2C_SENSOR
11 +       help
12 +         If you say yes here you get support for the Xicor x1205 RTC chip.
13
14 +         This driver can also be built as a module.  If so, the module
15 +         will be called x1205-rtc
16 +
17  config SENSORS_RTC8564
18         tristate "Epson 8564 RTC chip"
19         depends on I2C && EXPERIMENTA
20 --- drivers/i2c/chips/Makefile.old      2004-06-16 01:20:26.000000000 -0400
21 +++ drivers/i2c/chips/Makefile  2004-09-22 16:48:06.435580334 -0400
22 @@ -25,6 +25,7 @@
23  obj-$(CONFIG_SENSORS_RTC8564)  += rtc8564.o
24  obj-$(CONFIG_SENSORS_VIA686A)  += via686a.o
25  obj-$(CONFIG_SENSORS_W83L785TS)        += w83l785ts.o
26 +obj-$(CONFIG_SENSORS_X1205)     += x1205-rtc.o
27  
28  ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
29  EXTRA_CFLAGS += -DDEBUG
30
31 --- arch/arm/mach-ixp4xx/ixp425-time.c.old      1969-12-31 19:00:00.000000000 -0500
32 +++ arch/arm/mach-ixp4xx/ixp425-time.c  2004-09-22 23:30:54.165988077 -0400
33 @@ -0,0 +1,87 @@
34 +/*
35 + * arch/arm/mach-ixp425/ixp425-time.c
36 + *
37 + * Timer tick for IXP425 based sytems. We use OS timer1 on the CPU.
38 + *
39 + * Author:  Peter Barry
40 + * Copyright:   (C) 2001 Intel Corporation.
41 + *
42 + * Maintainer: Deepak Saxena <dsaxena@mvista.com>
43 + * 
44 + * This program is free software; you can redistribute it and/or modify
45 + * it under the terms of the GNU General Public License version 2 as
46 + * published by the Free Software Foundation.
47 + */
48 +
49 +
50 +#include <linux/config.h>
51 +#include <linux/module.h>
52 +#include <linux/sched.h>
53 +#include <linux/kernel.h>
54 +#include <linux/interrupt.h>
55 +#include <linux/time.h>
56 +#include <linux/init.h>
57 +#include <linux/smp.h>
58 +
59 +#include <asm/uaccess.h>
60 +#include <asm/io.h>
61 +#include <asm/irq.h>
62 +
63 +#include <linux/timex.h>
64 +#include <asm/hardware.h>
65 +
66 +
67 +extern int setup_arm_irq(int, struct irqaction *);
68 +
69 +/* IRQs are disabled before entering here from do_gettimeofday() */
70 +static unsigned long ixp425_gettimeoffset(void)
71 +{
72 +       u32 elapsed, usec, curr, reload;
73 +
74 +       /* 
75 +        * We need elapsed timer ticks since last interrupt
76 +        * 
77 +        * Read the CCNT value.  The returned value is 
78 +        * between -LATCH and 0, 0 corresponding to a full jiffy 
79 +        */
80 +
81 +       reload = *IXP425_OSRT1 & ~IXP425_OST_RELOAD_MASK;
82 +       curr = *IXP425_OST1;
83 +
84 +       /* Corner case when rolling over as int disabled ?? */
85 +       elapsed = reload - curr;
86 +
87 +       /* Now convert them to usec */
88 +       usec = (unsigned long)(elapsed * tick) / LATCH;
89 +
90 +       return usec;
91 +}
92 +
93 +static void ixp425_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
94 +{
95 +       /* Clear Pending Interrupt by writing '1' to it */
96 +       *IXP425_OSST = IXP425_OSST_TIMER_1_PEND;
97 +
98 +       do_timer(regs);
99 +}
100 +
101 +extern unsigned long (*gettimeoffset)(void);
102 +
103 +static struct irqaction timer_irq = {
104 +       name: "IXP425 Timer 1",
105 +};
106 +
107 +void __init setup_timer(void)
108 +{
109 +       gettimeoffset = ixp425_gettimeoffset;
110 +       timer_irq.handler = ixp425_timer_interrupt;
111 +
112 +       /* Clear Pending Interrupt by writing '1' to it */
113 +       *IXP425_OSST = IXP425_OSST_TIMER_1_PEND;
114 +
115 +       /* Setup the Timer counter value */
116 +       *IXP425_OSRT1 = (LATCH & ~IXP425_OST_RELOAD_MASK) | IXP425_OST_ENABLE;
117 +
118 +       /* Connect the interrupt handler and enable the interrupt */
119 +       setup_arm_irq(IRQ_IXP425_TIMER1, &ixp4xx_timer_irq);
120 +}
121 --- include/linux/i2c-id.h      2004-06-16 01:18:57.000000000 -0400
122 +++ include/linux/i2c-id.h.new  2004-09-23 00:56:30.772429217 -0400
123 @@ -101,7 +101,7 @@
124  #define I2C_DRIVERID_UDA1342   53      /* UDA1342 audio codec          */
125  #define I2C_DRIVERID_ADV7170   54      /* video encoder                */
126  #define I2C_DRIVERID_RADEON    55      /* I2C bus on Radeon boards     */
127 -
128 +#define I2C_DRIVERID_X1205     0xF0    /* Xicor X1205 RTC              */
129  
130  #define I2C_DRIVERID_EXP0      0xF0    /* experimental use id's        */
131  #define I2C_DRIVERID_EXP1      0xF1
132 --- archold/arm/kernel/time.c   2004-06-16 01:19:43.000000000 -0400
133 +++ arch/arm/kernel/time.c      2004-10-14 12:28:51.434231567 -0400
134 @@ -58,7 +58,7 @@ static int dummy_set_rtc(void)
135   * hook for setting the RTC's idea of the current time.
136   */
137  int (*set_rtc)(void) = dummy_set_rtc;
138 -
139 +EXPORT_SYMBOL(set_rtc);
140  static unsigned long dummy_gettimeoffset(void)
141  {
142         return 0;