blob: a6aae84e570656d9ef9b54bed57142c438d59211 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * i2c-au1550.c: SMBus (i2c) adapter for Alchemy PSC interface
3 * Copyright (C) 2004 Embedded Edge, LLC <dan@embeddededge.com>
4 *
5 * 2.6 port by Matt Porter <mporter@kernel.crashing.org>
6 *
7 * The documentation describes this as an SMBus controller, but it doesn't
8 * understand any of the SMBus protocol in hardware. It's really an I2C
9 * controller that could emulate most of the SMBus in software.
10 *
11 * This is just a skeleton adapter to use with the Au1550 PSC
12 * algorithm. It was developed for the Pb1550, but will work with
13 * any Au1550 board that has a similar PSC configuration.
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 */
25
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#include <linux/delay.h>
27#include <linux/kernel.h>
28#include <linux/module.h>
Manuel Lauss8b798c42008-01-27 18:14:52 +010029#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070030#include <linux/errno.h>
31#include <linux/i2c.h>
Manuel Lauss8b798c42008-01-27 18:14:52 +010032#include <linux/slab.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070033
Manuel Lauss50d56762011-08-12 11:39:43 +020034#include <asm/mach-au1x00/au1000.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070035#include <asm/mach-au1x00/au1xxx_psc.h>
36
Manuel Laussc5de6462011-10-22 13:34:36 +020037#define PSC_SEL 0x00
38#define PSC_CTRL 0x04
39#define PSC_SMBCFG 0x08
40#define PSC_SMBMSK 0x0C
41#define PSC_SMBPCR 0x10
42#define PSC_SMBSTAT 0x14
43#define PSC_SMBEVNT 0x18
44#define PSC_SMBTXRX 0x1C
45#define PSC_SMBTMR 0x20
46
Manuel Lauss8b798c42008-01-27 18:14:52 +010047struct i2c_au1550_data {
Manuel Laussc5de6462011-10-22 13:34:36 +020048 void __iomem *psc_base;
Manuel Lauss8b798c42008-01-27 18:14:52 +010049 int xfer_timeout;
Manuel Lauss8b798c42008-01-27 18:14:52 +010050 struct i2c_adapter adap;
51 struct resource *ioarea;
52};
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Manuel Laussc5de6462011-10-22 13:34:36 +020054static inline void WR(struct i2c_au1550_data *a, int r, unsigned long v)
Linus Torvalds1da177e2005-04-16 15:20:36 -070055{
Manuel Laussc5de6462011-10-22 13:34:36 +020056 __raw_writel(v, a->psc_base + r);
57 wmb();
58}
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Manuel Laussc5de6462011-10-22 13:34:36 +020060static inline unsigned long RD(struct i2c_au1550_data *a, int r)
61{
62 return __raw_readl(a->psc_base + r);
63}
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
Manuel Laussc5de6462011-10-22 13:34:36 +020065static int wait_xfer_done(struct i2c_au1550_data *adap)
66{
67 int i;
68
69 /* Wait for Tx Buffer Empty */
Linus Torvalds1da177e2005-04-16 15:20:36 -070070 for (i = 0; i < adap->xfer_timeout; i++) {
Manuel Laussc5de6462011-10-22 13:34:36 +020071 if (RD(adap, PSC_SMBSTAT) & PSC_SMBSTAT_TE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070072 return 0;
Chris Davida2027072007-10-13 23:56:33 +020073
Linus Torvalds1da177e2005-04-16 15:20:36 -070074 udelay(1);
75 }
76
77 return -ETIMEDOUT;
78}
79
Manuel Laussc5de6462011-10-22 13:34:36 +020080static int wait_ack(struct i2c_au1550_data *adap)
Linus Torvalds1da177e2005-04-16 15:20:36 -070081{
Manuel Laussc5de6462011-10-22 13:34:36 +020082 unsigned long stat;
Linus Torvalds1da177e2005-04-16 15:20:36 -070083
84 if (wait_xfer_done(adap))
85 return -ETIMEDOUT;
86
Manuel Laussc5de6462011-10-22 13:34:36 +020087 stat = RD(adap, PSC_SMBEVNT);
Linus Torvalds1da177e2005-04-16 15:20:36 -070088 if ((stat & (PSC_SMBEVNT_DN | PSC_SMBEVNT_AN | PSC_SMBEVNT_AL)) != 0)
89 return -ETIMEDOUT;
90
91 return 0;
92}
93
Manuel Laussc5de6462011-10-22 13:34:36 +020094static int wait_master_done(struct i2c_au1550_data *adap)
Linus Torvalds1da177e2005-04-16 15:20:36 -070095{
Manuel Laussc5de6462011-10-22 13:34:36 +020096 int i;
Linus Torvalds1da177e2005-04-16 15:20:36 -070097
Manuel Laussc5de6462011-10-22 13:34:36 +020098 /* Wait for Master Done. */
Manuel Lauss84785f12011-10-22 13:34:38 +020099 for (i = 0; i < 2 * adap->xfer_timeout; i++) {
Manuel Laussc5de6462011-10-22 13:34:36 +0200100 if ((RD(adap, PSC_SMBEVNT) & PSC_SMBEVNT_MD) != 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101 return 0;
102 udelay(1);
103 }
104
105 return -ETIMEDOUT;
106}
107
108static int
Manuel Lauss91f27952008-01-27 18:14:52 +0100109do_address(struct i2c_au1550_data *adap, unsigned int addr, int rd, int q)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110{
Manuel Laussc5de6462011-10-22 13:34:36 +0200111 unsigned long stat;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112
Manuel Laussc5de6462011-10-22 13:34:36 +0200113 /* Reset the FIFOs, clear events. */
114 stat = RD(adap, PSC_SMBSTAT);
115 WR(adap, PSC_SMBEVNT, PSC_SMBEVNT_ALLCLR);
Domen Puncer88599422006-08-13 23:35:40 +0200116
117 if (!(stat & PSC_SMBSTAT_TE) || !(stat & PSC_SMBSTAT_RE)) {
Manuel Laussc5de6462011-10-22 13:34:36 +0200118 WR(adap, PSC_SMBPCR, PSC_SMBPCR_DC);
119 while ((RD(adap, PSC_SMBPCR) & PSC_SMBPCR_DC) != 0)
120 cpu_relax();
Domen Puncer88599422006-08-13 23:35:40 +0200121 udelay(50);
122 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123
Manuel Laussc5de6462011-10-22 13:34:36 +0200124 /* Write out the i2c chip address and specify operation */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 addr <<= 1;
126 if (rd)
127 addr |= 1;
128
Manuel Lauss91f27952008-01-27 18:14:52 +0100129 /* zero-byte xfers stop immediately */
130 if (q)
131 addr |= PSC_SMBTXRX_STP;
132
Manuel Laussc5de6462011-10-22 13:34:36 +0200133 /* Put byte into fifo, start up master. */
134 WR(adap, PSC_SMBTXRX, addr);
135 WR(adap, PSC_SMBPCR, PSC_SMBPCR_MS);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136 if (wait_ack(adap))
137 return -EIO;
Manuel Lauss91f27952008-01-27 18:14:52 +0100138 return (q) ? wait_master_done(adap) : 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139}
140
Manuel Laussc5de6462011-10-22 13:34:36 +0200141static int wait_for_rx_byte(struct i2c_au1550_data *adap, unsigned char *out)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142{
Manuel Laussc5de6462011-10-22 13:34:36 +0200143 int j;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144
145 if (wait_xfer_done(adap))
146 return -EIO;
147
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148 j = adap->xfer_timeout * 100;
149 do {
150 j--;
151 if (j <= 0)
152 return -EIO;
153
Manuel Laussc5de6462011-10-22 13:34:36 +0200154 if ((RD(adap, PSC_SMBSTAT) & PSC_SMBSTAT_RE) == 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155 j = 0;
156 else
157 udelay(1);
158 } while (j > 0);
Manuel Laussc5de6462011-10-22 13:34:36 +0200159
160 *out = RD(adap, PSC_SMBTXRX);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161
162 return 0;
163}
164
Manuel Laussc5de6462011-10-22 13:34:36 +0200165static int i2c_read(struct i2c_au1550_data *adap, unsigned char *buf,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166 unsigned int len)
167{
Manuel Laussc5de6462011-10-22 13:34:36 +0200168 int i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169
170 if (len == 0)
171 return 0;
172
173 /* A read is performed by stuffing the transmit fifo with
174 * zero bytes for timing, waiting for bytes to appear in the
175 * receive fifo, then reading the bytes.
176 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177 i = 0;
Manuel Laussc5de6462011-10-22 13:34:36 +0200178 while (i < (len - 1)) {
179 WR(adap, PSC_SMBTXRX, 0);
180 if (wait_for_rx_byte(adap, &buf[i]))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181 return -EIO;
182
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 i++;
184 }
185
Manuel Laussc5de6462011-10-22 13:34:36 +0200186 /* The last byte has to indicate transfer done. */
187 WR(adap, PSC_SMBTXRX, PSC_SMBTXRX_STP);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188 if (wait_master_done(adap))
189 return -EIO;
190
Manuel Laussc5de6462011-10-22 13:34:36 +0200191 buf[i] = (unsigned char)(RD(adap, PSC_SMBTXRX) & 0xff);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192 return 0;
193}
194
Manuel Laussc5de6462011-10-22 13:34:36 +0200195static int i2c_write(struct i2c_au1550_data *adap, unsigned char *buf,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 unsigned int len)
197{
Manuel Laussc5de6462011-10-22 13:34:36 +0200198 int i;
199 unsigned long data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200
201 if (len == 0)
202 return 0;
203
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204 i = 0;
205 while (i < (len-1)) {
206 data = buf[i];
Manuel Laussc5de6462011-10-22 13:34:36 +0200207 WR(adap, PSC_SMBTXRX, data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208 if (wait_ack(adap))
209 return -EIO;
210 i++;
211 }
212
Manuel Laussc5de6462011-10-22 13:34:36 +0200213 /* The last byte has to indicate transfer done. */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214 data = buf[i];
215 data |= PSC_SMBTXRX_STP;
Manuel Laussc5de6462011-10-22 13:34:36 +0200216 WR(adap, PSC_SMBTXRX, data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217 if (wait_master_done(adap))
218 return -EIO;
219 return 0;
220}
221
222static int
223au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
224{
225 struct i2c_au1550_data *adap = i2c_adap->algo_data;
226 struct i2c_msg *p;
227 int i, err = 0;
228
Manuel Laussc5de6462011-10-22 13:34:36 +0200229 WR(adap, PSC_CTRL, PSC_CTRL_ENABLE);
Manuel Laussf09f71b2008-07-14 22:38:34 +0200230
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231 for (i = 0; !err && i < num; i++) {
232 p = &msgs[i];
Manuel Lauss91f27952008-01-27 18:14:52 +0100233 err = do_address(adap, p->addr, p->flags & I2C_M_RD,
234 (p->len == 0));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235 if (err || !p->len)
236 continue;
237 if (p->flags & I2C_M_RD)
238 err = i2c_read(adap, p->buf, p->len);
239 else
240 err = i2c_write(adap, p->buf, p->len);
241 }
242
243 /* Return the number of messages processed, or the error code.
244 */
245 if (err == 0)
246 err = num;
Manuel Laussf09f71b2008-07-14 22:38:34 +0200247
Manuel Laussc5de6462011-10-22 13:34:36 +0200248 WR(adap, PSC_CTRL, PSC_CTRL_SUSPEND);
Manuel Laussf09f71b2008-07-14 22:38:34 +0200249
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250 return err;
251}
252
Manuel Laussc5de6462011-10-22 13:34:36 +0200253static u32 au1550_func(struct i2c_adapter *adap)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254{
Domen Puncer6ed07132006-08-13 23:36:27 +0200255 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256}
257
Jean Delvare8f9082c2006-09-03 22:39:46 +0200258static const struct i2c_algorithm au1550_algo = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259 .master_xfer = au1550_xfer,
260 .functionality = au1550_func,
261};
262
Manuel Laussf09f71b2008-07-14 22:38:34 +0200263static void i2c_au1550_setup(struct i2c_au1550_data *priv)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264{
Manuel Laussc5de6462011-10-22 13:34:36 +0200265 unsigned long cfg;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266
Manuel Laussc5de6462011-10-22 13:34:36 +0200267 WR(priv, PSC_CTRL, PSC_CTRL_DISABLE);
268 WR(priv, PSC_SEL, PSC_SEL_PS_SMBUSMODE);
269 WR(priv, PSC_SMBCFG, 0);
270 WR(priv, PSC_CTRL, PSC_CTRL_ENABLE);
271 while ((RD(priv, PSC_SMBSTAT) & PSC_SMBSTAT_SR) == 0)
272 cpu_relax();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273
Manuel Laussc5de6462011-10-22 13:34:36 +0200274 cfg = PSC_SMBCFG_RT_FIFO8 | PSC_SMBCFG_TT_FIFO8 | PSC_SMBCFG_DD_DISABLE;
275 WR(priv, PSC_SMBCFG, cfg);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276
277 /* Divide by 8 to get a 6.25 MHz clock. The later protocol
278 * timings are based on this clock.
279 */
Manuel Laussc5de6462011-10-22 13:34:36 +0200280 cfg |= PSC_SMBCFG_SET_DIV(PSC_SMBCFG_DIV8);
281 WR(priv, PSC_SMBCFG, cfg);
282 WR(priv, PSC_SMBMSK, PSC_SMBMSK_ALLMASK);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283
284 /* Set the protocol timer values. See Table 71 in the
285 * Au1550 Data Book for standard timing values.
286 */
Manuel Laussc5de6462011-10-22 13:34:36 +0200287 WR(priv, PSC_SMBTMR, PSC_SMBTMR_SET_TH(0) | PSC_SMBTMR_SET_PS(15) | \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288 PSC_SMBTMR_SET_PU(15) | PSC_SMBTMR_SET_SH(15) | \
289 PSC_SMBTMR_SET_SU(15) | PSC_SMBTMR_SET_CL(15) | \
Manuel Laussc5de6462011-10-22 13:34:36 +0200290 PSC_SMBTMR_SET_CH(15));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291
Manuel Laussc5de6462011-10-22 13:34:36 +0200292 cfg |= PSC_SMBCFG_DE_ENABLE;
293 WR(priv, PSC_SMBCFG, cfg);
294 while ((RD(priv, PSC_SMBSTAT) & PSC_SMBSTAT_SR) == 0)
295 cpu_relax();
Manuel Laussf09f71b2008-07-14 22:38:34 +0200296
Manuel Laussc5de6462011-10-22 13:34:36 +0200297 WR(priv, PSC_CTRL, PSC_CTRL_SUSPEND);
Manuel Laussf09f71b2008-07-14 22:38:34 +0200298}
299
300static void i2c_au1550_disable(struct i2c_au1550_data *priv)
301{
Manuel Laussc5de6462011-10-22 13:34:36 +0200302 WR(priv, PSC_SMBCFG, 0);
303 WR(priv, PSC_CTRL, PSC_CTRL_DISABLE);
Manuel Laussf09f71b2008-07-14 22:38:34 +0200304}
305
306/*
307 * registering functions to load algorithms at runtime
308 * Prior to calling us, the 50MHz clock frequency and routing
309 * must have been set up for the PSC indicated by the adapter.
310 */
Bill Pemberton0b255e92012-11-27 15:59:38 -0500311static int
Manuel Laussf09f71b2008-07-14 22:38:34 +0200312i2c_au1550_probe(struct platform_device *pdev)
313{
314 struct i2c_au1550_data *priv;
315 struct resource *r;
316 int ret;
317
318 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
319 if (!r) {
320 ret = -ENODEV;
321 goto out;
322 }
323
324 priv = kzalloc(sizeof(struct i2c_au1550_data), GFP_KERNEL);
325 if (!priv) {
326 ret = -ENOMEM;
327 goto out;
328 }
329
Linus Walleijc6ffdde2009-06-14 00:20:36 +0200330 priv->ioarea = request_mem_region(r->start, resource_size(r),
Manuel Laussf09f71b2008-07-14 22:38:34 +0200331 pdev->name);
332 if (!priv->ioarea) {
333 ret = -EBUSY;
334 goto out_mem;
335 }
336
Manuel Laussc5de6462011-10-22 13:34:36 +0200337 priv->psc_base = ioremap(r->start, resource_size(r));
338 if (!priv->psc_base) {
339 ret = -EIO;
340 goto out_map;
341 }
Manuel Laussf09f71b2008-07-14 22:38:34 +0200342 priv->xfer_timeout = 200;
Manuel Laussf09f71b2008-07-14 22:38:34 +0200343
Manuel Laussf09f71b2008-07-14 22:38:34 +0200344 priv->adap.nr = pdev->id;
345 priv->adap.algo = &au1550_algo;
346 priv->adap.algo_data = priv;
347 priv->adap.dev.parent = &pdev->dev;
348 strlcpy(priv->adap.name, "Au1xxx PSC I2C", sizeof(priv->adap.name));
349
Manuel Laussc5de6462011-10-22 13:34:36 +0200350 /* Now, set up the PSC for SMBus PIO mode. */
Manuel Laussf09f71b2008-07-14 22:38:34 +0200351 i2c_au1550_setup(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352
Manuel Lauss8b798c42008-01-27 18:14:52 +0100353 ret = i2c_add_numbered_adapter(&priv->adap);
354 if (ret == 0) {
355 platform_set_drvdata(pdev, priv);
356 return 0;
357 }
358
Manuel Laussf09f71b2008-07-14 22:38:34 +0200359 i2c_au1550_disable(priv);
Manuel Laussc5de6462011-10-22 13:34:36 +0200360 iounmap(priv->psc_base);
361out_map:
Manuel Lauss8b798c42008-01-27 18:14:52 +0100362 release_resource(priv->ioarea);
363 kfree(priv->ioarea);
364out_mem:
365 kfree(priv);
366out:
367 return ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368}
369
Bill Pemberton0b255e92012-11-27 15:59:38 -0500370static int i2c_au1550_remove(struct platform_device *pdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700371{
Manuel Lauss8b798c42008-01-27 18:14:52 +0100372 struct i2c_au1550_data *priv = platform_get_drvdata(pdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373
Manuel Lauss8b798c42008-01-27 18:14:52 +0100374 i2c_del_adapter(&priv->adap);
Manuel Laussf09f71b2008-07-14 22:38:34 +0200375 i2c_au1550_disable(priv);
Manuel Laussc5de6462011-10-22 13:34:36 +0200376 iounmap(priv->psc_base);
Manuel Lauss8b798c42008-01-27 18:14:52 +0100377 release_resource(priv->ioarea);
378 kfree(priv->ioarea);
379 kfree(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380 return 0;
381}
382
Manuel Laussf09f71b2008-07-14 22:38:34 +0200383#ifdef CONFIG_PM
Manuel Lauss46f344e22011-10-22 13:34:39 +0200384static int i2c_au1550_suspend(struct device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700385{
Manuel Lauss46f344e22011-10-22 13:34:39 +0200386 struct i2c_au1550_data *priv = dev_get_drvdata(dev);
Manuel Lauss8b798c42008-01-27 18:14:52 +0100387
Manuel Laussf09f71b2008-07-14 22:38:34 +0200388 i2c_au1550_disable(priv);
389
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390 return 0;
391}
392
Manuel Lauss46f344e22011-10-22 13:34:39 +0200393static int i2c_au1550_resume(struct device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394{
Manuel Lauss46f344e22011-10-22 13:34:39 +0200395 struct i2c_au1550_data *priv = dev_get_drvdata(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396
Manuel Laussf09f71b2008-07-14 22:38:34 +0200397 i2c_au1550_setup(priv);
398
Manuel Lauss8b798c42008-01-27 18:14:52 +0100399 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400}
Manuel Lauss46f344e22011-10-22 13:34:39 +0200401
402static const struct dev_pm_ops i2c_au1550_pmops = {
403 .suspend = i2c_au1550_suspend,
404 .resume = i2c_au1550_resume,
405};
406
407#define AU1XPSC_SMBUS_PMOPS (&i2c_au1550_pmops)
408
Manuel Laussf09f71b2008-07-14 22:38:34 +0200409#else
Manuel Lauss46f344e22011-10-22 13:34:39 +0200410#define AU1XPSC_SMBUS_PMOPS NULL
Manuel Laussf09f71b2008-07-14 22:38:34 +0200411#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412
Manuel Lauss8b798c42008-01-27 18:14:52 +0100413static struct platform_driver au1xpsc_smbus_driver = {
414 .driver = {
415 .name = "au1xpsc_smbus",
Manuel Lauss46f344e22011-10-22 13:34:39 +0200416 .pm = AU1XPSC_SMBUS_PMOPS,
Manuel Lauss8b798c42008-01-27 18:14:52 +0100417 },
418 .probe = i2c_au1550_probe,
Bill Pemberton0b255e92012-11-27 15:59:38 -0500419 .remove = i2c_au1550_remove,
Manuel Lauss8b798c42008-01-27 18:14:52 +0100420};
421
Axel Lina3664b52012-01-12 20:32:04 +0100422module_platform_driver(au1xpsc_smbus_driver);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700423
424MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC.");
425MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550");
426MODULE_LICENSE("GPL");
Kay Sieversadd8eda2008-04-22 22:16:49 +0200427MODULE_ALIAS("platform:au1xpsc_smbus");