summaryrefslogtreecommitdiff
path: root/arch/arm/mach-sa1100/ipaq-sleeve-cf.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-sa1100/ipaq-sleeve-cf.c')
-rw-r--r--arch/arm/mach-sa1100/ipaq-sleeve-cf.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/arch/arm/mach-sa1100/ipaq-sleeve-cf.c b/arch/arm/mach-sa1100/ipaq-sleeve-cf.c
new file mode 100644
index 000000000000..8f0b8ae8b75c
--- /dev/null
+++ b/arch/arm/mach-sa1100/ipaq-sleeve-cf.c
@@ -0,0 +1,70 @@
+#include <linux/ipaq-sleeve.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+
+struct ipaq_sleeve_cf_data {
+ struct platform_device *skt;
+};
+
+static int ipaq_sleeve_cf_probe(struct device *dev)
+{
+ struct ipaq_option_device *idev = to_ipaq_option_device(dev);
+ struct ipaq_sleeve_cf_data *cf;
+ struct platform_device_info pinfo = {
+ .parent = dev,
+ .name = "sa11x0-pcmcia",
+ .id = 0,
+ .data = &idev->id,
+ .size_data = sizeof(idev->id),
+ };
+
+ cf = devm_kzalloc(dev, sizeof(*cf), GFP_KERNEL);
+ if (!cf)
+ return -ENOMEM;
+
+ cf->skt = platform_device_register_full(&pinfo);
+ if (IS_ERR(cf->skt)) {
+ dev_err(dev, "unable to register pcmcia device: %ld\n",
+ PTR_ERR(cf->skt));
+ return PTR_ERR(cf->skt);
+ }
+
+ dev_set_drvdata(dev, cf);
+
+ return 0;
+}
+
+static int ipaq_sleeve_cf_remove(struct device *dev)
+{
+ struct ipaq_sleeve_cf_data *cf = dev_get_drvdata(dev);
+
+ platform_device_unregister(cf->skt);
+
+ return 0;
+}
+
+static const struct ipaq_option_id ipaq_sleeve_cf_ids[] = {
+ { /* Compaq CompactFlash sleeve */
+ .vendor = 0x1125,
+ .device = 0xcf11,
+ }, { /* Compaq single PCMCIA sleeve */
+ .vendor = 0x1125,
+ .device = 0xd7c3,
+ }, { },
+};
+
+static struct ipaq_option_driver ipaq_sleeve_cf = {
+ .id_table = ipaq_sleeve_cf_ids,
+ .driver = {
+ .name = "ipaq-sleeve-cf",
+ .probe = ipaq_sleeve_cf_probe,
+ .remove = ipaq_sleeve_cf_remove,
+ },
+};
+
+module_driver(ipaq_sleeve_cf, ipaq_option_driver_register,
+ ipaq_option_driver_unregister);
+
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(ipaq, ipaq_sleeve_cf_ids);