2 * IR port driver for the Cirrus Logic CLPS711X processors
4 * Copyright 2001, Blue Mug Inc. All rights reserved.
8 #include <linux/module.h>
9 #include <linux/platform_device.h>
11 #include <mach/hardware.h>
15 static int clps711x_dongle_open(struct sir_dev *dev)
19 /* Turn on the SIR encoder. */
20 syscon = clps_readl(SYSCON1);
21 syscon |= SYSCON1_SIREN;
22 clps_writel(syscon, SYSCON1);
27 static int clps711x_dongle_close(struct sir_dev *dev)
31 /* Turn off the SIR encoder. */
32 syscon = clps_readl(SYSCON1);
33 syscon &= ~SYSCON1_SIREN;
34 clps_writel(syscon, SYSCON1);
39 static struct dongle_driver clps711x_dongle = {
41 .driver_name = "EP7211 IR driver",
42 .type = IRDA_EP7211_DONGLE,
43 .open = clps711x_dongle_open,
44 .close = clps711x_dongle_close,
47 static int clps711x_sir_probe(struct platform_device *pdev)
49 return irda_register_dongle(&clps711x_dongle);
52 static int clps711x_sir_remove(struct platform_device *pdev)
54 return irda_unregister_dongle(&clps711x_dongle);
57 static struct platform_driver clps711x_sir_driver = {
59 .name = "sir-clps711x",
62 .probe = clps711x_sir_probe,
63 .remove = clps711x_sir_remove,
65 module_platform_driver(clps711x_sir_driver);
68 MODULE_DESCRIPTION("EP7211 IR dongle driver");
69 MODULE_LICENSE("GPL");
70 MODULE_ALIAS("irda-dongle-13"); /* IRDA_EP7211_DONGLE */