8 #include <linux/kernel.h>
9 #include <linux/module.h>
12 #include <linux/serial_core.h>
13 #include <linux/slab.h>
19 #include <asm/sizes.h>
21 #include <mach/hardware.h>
24 #include <mach/irqs.h>
26 #define NEP_IRQ_SMC91X 0
27 #define NEP_IRQ_USAR 1
28 #define NEP_IRQ_SA1111 2
38 #define MDM_CTL_0 0xb0
39 #define MDM_CTL_1 0xb4
42 #define IRR_ETHERNET (1 << 0)
43 #define IRR_USAR (1 << 1)
44 #define IRR_SA1111 (1 << 2)
46 #define MDM_CTL0_RTS1 (1 << 0)
47 #define MDM_CTL0_DTR1 (1 << 1)
48 #define MDM_CTL0_RTS2 (1 << 2)
49 #define MDM_CTL0_DTR2 (1 << 3)
51 #define MDM_CTL1_CTS1 (1 << 0)
52 #define MDM_CTL1_DSR1 (1 << 1)
53 #define MDM_CTL1_DCD1 (1 << 2)
54 #define MDM_CTL1_CTS2 (1 << 3)
55 #define MDM_CTL1_DSR2 (1 << 4)
56 #define MDM_CTL1_DCD2 (1 << 5)
58 #define AUD_SEL_1341 (1 << 0)
59 #define AUD_MUTE_1341 (1 << 1)
68 #ifdef CONFIG_PM_SLEEP
86 writeb_relaxed((v & ~mask) | val, base +
NCR_0);
89 WARN(1,
"nep_base unset\n");
114 if (mctrl & TIOCM_RTS)
125 writeb_relaxed(mdm_ctl0, base +
MDM_CTL_0);
158 .set_mctrl = neponset_set_mctrl,
159 .get_mctrl = neponset_get_mctrl,
168 static void neponset_irq_handler(
unsigned int irq,
struct irq_desc *
desc)
221 static void nochip_noop(
struct irq_data *irq)
227 .irq_ack = nochip_noop,
228 .irq_mask = nochip_noop,
229 .irq_unmask = nochip_noop,
239 struct resource *nep_res, *sa1111_res, *smc91x_res;
240 struct resource sa1111_resources[] = {
248 .res = sa1111_resources,
250 .data = &sa1111_info,
251 .size_data =
sizeof(sa1111_info),
254 struct resource smc91x_resources[] = {
256 0x02000000,
"smc91x-regs"),
258 0x02000000,
"smc91x-attrib"),
265 .res = smc91x_resources,
280 if (!nep_res || !smc91x_res || !sa1111_res) {
298 dev_warn(&dev->
dev,
"Neponset board detected, but wrong ID: %02x\n",
306 dev_err(&dev->
dev,
"unable to allocate %u irqs: %d\n",
325 irq_set_chained_handler(irq, neponset_irq_handler);
332 enable_irq_wake(irq);
335 dev_info(&dev->
dev,
"Neponset daughter board, providing IRQ%u-%u\n",
347 sa1111_resources[0].
parent = sa1111_res;
352 smc91x_resources[0].
parent = smc91x_res;
353 smc91x_resources[1].
parent = smc91x_res;
358 platform_set_drvdata(dev, d);
380 irq_set_chained_handler(irq,
NULL);
389 #ifdef CONFIG_PM_SLEEP
390 static int neponset_suspend(
struct device *dev)
400 static int neponset_resume(
struct device *dev)
404 writeb_relaxed(d->ncr0, d->
base +
NCR_0);
410 static const struct dev_pm_ops neponset_pm_ops = {
412 .resume_noirq = neponset_resume,
413 .freeze_noirq = neponset_suspend,
414 .restore_noirq = neponset_resume,
416 #define PM_OPS &neponset_pm_ops
422 .probe = neponset_probe,
431 static int __init neponset_init(
void)