31 #include <linux/kernel.h>
32 #include <linux/module.h>
35 #include <linux/errno.h>
36 #include <linux/i2c.h>
37 #include <linux/slab.h>
44 #define PSC_SMBCFG 0x08
45 #define PSC_SMBMSK 0x0C
46 #define PSC_SMBPCR 0x10
47 #define PSC_SMBSTAT 0x14
48 #define PSC_SMBEVNT 0x18
49 #define PSC_SMBTXRX 0x1C
50 #define PSC_SMBTMR 0x20
89 if (wait_xfer_done(adap))
143 return (q) ? wait_master_done(adap) : 0;
150 if (wait_xfer_done(adap))
183 while (i < (len - 1)) {
185 if (wait_for_rx_byte(adap, &buf[i]))
193 if (wait_master_done(adap))
210 while (i < (len-1)) {
222 if (wait_master_done(adap))
236 for (i = 0; !err && i < num; i++) {
264 .master_xfer = au1550_xfer,
265 .functionality = au1550_func,
350 priv->
adap.algo = &au1550_algo;
352 priv->
adap.dev.parent = &pdev->
dev;
356 i2c_au1550_setup(priv);
360 platform_set_drvdata(pdev, priv);
364 i2c_au1550_disable(priv);
379 platform_set_drvdata(pdev,
NULL);
381 i2c_au1550_disable(priv);
390 static int i2c_au1550_suspend(
struct device *
dev)
394 i2c_au1550_disable(priv);
399 static int i2c_au1550_resume(
struct device *
dev)
403 i2c_au1550_setup(priv);
408 static const struct dev_pm_ops i2c_au1550_pmops = {
410 .resume = i2c_au1550_resume,
413 #define AU1XPSC_SMBUS_PMOPS (&i2c_au1550_pmops)
416 #define AU1XPSC_SMBUS_PMOPS NULL
421 .name =
"au1xpsc_smbus",
425 .probe = i2c_au1550_probe,