Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Palmas USB transceiver driver |
| 3 | * |
| 4 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * Author: Graeme Gregory <gg@slimlogic.co.uk> |
| 11 | * Author: Kishon Vijay Abraham I <kishon@ti.com> |
| 12 | * |
| 13 | * Based on twl6030_usb.c |
| 14 | * |
| 15 | * Author: Hema HK <hemahk@ti.com> |
| 16 | * |
| 17 | * This program is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | * GNU General Public License for more details. |
| 21 | */ |
| 22 | |
| 23 | #include <linux/module.h> |
| 24 | #include <linux/interrupt.h> |
| 25 | #include <linux/platform_device.h> |
Kishon Vijay Abraham I | f63d32d | 2014-03-28 12:21:02 +0530 | [diff] [blame] | 26 | #include <linux/slab.h> |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 27 | #include <linux/err.h> |
| 28 | #include <linux/mfd/palmas.h> |
| 29 | #include <linux/of.h> |
| 30 | #include <linux/of_platform.h> |
| 31 | |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame^] | 32 | static const enum extcon palmas_extcon_cable[] = { |
| 33 | EXTCON_USB, |
| 34 | EXTCON_USB_HOST, |
| 35 | EXTCON_NONE, |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | static const int mutually_exclusive[] = {0x3, 0x0}; |
| 39 | |
| 40 | static void palmas_usb_wakeup(struct palmas *palmas, int enable) |
| 41 | { |
| 42 | if (enable) |
| 43 | palmas_write(palmas, PALMAS_USB_OTG_BASE, PALMAS_USB_WAKEUP, |
| 44 | PALMAS_USB_WAKEUP_ID_WK_UP_COMP); |
| 45 | else |
| 46 | palmas_write(palmas, PALMAS_USB_OTG_BASE, PALMAS_USB_WAKEUP, 0); |
| 47 | } |
| 48 | |
| 49 | static irqreturn_t palmas_vbus_irq_handler(int irq, void *_palmas_usb) |
| 50 | { |
| 51 | struct palmas_usb *palmas_usb = _palmas_usb; |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame^] | 52 | struct extcon_dev *edev = palmas_usb->edev; |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 53 | unsigned int vbus_line_state; |
| 54 | |
| 55 | palmas_read(palmas_usb->palmas, PALMAS_INTERRUPT_BASE, |
| 56 | PALMAS_INT3_LINE_STATE, &vbus_line_state); |
| 57 | |
| 58 | if (vbus_line_state & PALMAS_INT3_LINE_STATE_VBUS) { |
| 59 | if (palmas_usb->linkstat != PALMAS_USB_STATE_VBUS) { |
| 60 | palmas_usb->linkstat = PALMAS_USB_STATE_VBUS; |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame^] | 61 | extcon_set_cable_state_(edev, EXTCON_USB, true); |
Laxman Dewangan | 002945f | 2013-07-09 18:34:22 +0530 | [diff] [blame] | 62 | dev_info(palmas_usb->dev, "USB cable is attached\n"); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 63 | } else { |
| 64 | dev_dbg(palmas_usb->dev, |
| 65 | "Spurious connect event detected\n"); |
| 66 | } |
| 67 | } else if (!(vbus_line_state & PALMAS_INT3_LINE_STATE_VBUS)) { |
| 68 | if (palmas_usb->linkstat == PALMAS_USB_STATE_VBUS) { |
| 69 | palmas_usb->linkstat = PALMAS_USB_STATE_DISCONNECT; |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame^] | 70 | extcon_set_cable_state_(edev, EXTCON_USB, false); |
Laxman Dewangan | 002945f | 2013-07-09 18:34:22 +0530 | [diff] [blame] | 71 | dev_info(palmas_usb->dev, "USB cable is detached\n"); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 72 | } else { |
| 73 | dev_dbg(palmas_usb->dev, |
| 74 | "Spurious disconnect event detected\n"); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | return IRQ_HANDLED; |
| 79 | } |
| 80 | |
| 81 | static irqreturn_t palmas_id_irq_handler(int irq, void *_palmas_usb) |
| 82 | { |
George Cherian | b7d2d5b | 2013-10-11 00:18:39 +0530 | [diff] [blame] | 83 | unsigned int set, id_src; |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 84 | struct palmas_usb *palmas_usb = _palmas_usb; |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame^] | 85 | struct extcon_dev *edev = palmas_usb->edev; |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 86 | |
| 87 | palmas_read(palmas_usb->palmas, PALMAS_USB_OTG_BASE, |
| 88 | PALMAS_USB_ID_INT_LATCH_SET, &set); |
George Cherian | b7d2d5b | 2013-10-11 00:18:39 +0530 | [diff] [blame] | 89 | palmas_read(palmas_usb->palmas, PALMAS_USB_OTG_BASE, |
| 90 | PALMAS_USB_ID_INT_SRC, &id_src); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 91 | |
George Cherian | b7d2d5b | 2013-10-11 00:18:39 +0530 | [diff] [blame] | 92 | if ((set & PALMAS_USB_ID_INT_SRC_ID_GND) && |
| 93 | (id_src & PALMAS_USB_ID_INT_SRC_ID_GND)) { |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 94 | palmas_write(palmas_usb->palmas, PALMAS_USB_OTG_BASE, |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 95 | PALMAS_USB_ID_INT_LATCH_CLR, |
| 96 | PALMAS_USB_ID_INT_EN_HI_CLR_ID_GND); |
| 97 | palmas_usb->linkstat = PALMAS_USB_STATE_ID; |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame^] | 98 | extcon_set_cable_state_(edev, EXTCON_USB_HOST, true); |
Laxman Dewangan | 002945f | 2013-07-09 18:34:22 +0530 | [diff] [blame] | 99 | dev_info(palmas_usb->dev, "USB-HOST cable is attached\n"); |
George Cherian | b7d2d5b | 2013-10-11 00:18:39 +0530 | [diff] [blame] | 100 | } else if ((set & PALMAS_USB_ID_INT_SRC_ID_FLOAT) && |
| 101 | (id_src & PALMAS_USB_ID_INT_SRC_ID_FLOAT)) { |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 102 | palmas_write(palmas_usb->palmas, PALMAS_USB_OTG_BASE, |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 103 | PALMAS_USB_ID_INT_LATCH_CLR, |
| 104 | PALMAS_USB_ID_INT_EN_HI_CLR_ID_FLOAT); |
| 105 | palmas_usb->linkstat = PALMAS_USB_STATE_DISCONNECT; |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame^] | 106 | extcon_set_cable_state_(edev, EXTCON_USB_HOST, false); |
Laxman Dewangan | 002945f | 2013-07-09 18:34:22 +0530 | [diff] [blame] | 107 | dev_info(palmas_usb->dev, "USB-HOST cable is detached\n"); |
| 108 | } else if ((palmas_usb->linkstat == PALMAS_USB_STATE_ID) && |
| 109 | (!(set & PALMAS_USB_ID_INT_SRC_ID_GND))) { |
| 110 | palmas_usb->linkstat = PALMAS_USB_STATE_DISCONNECT; |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame^] | 111 | extcon_set_cable_state_(edev, EXTCON_USB_HOST, false); |
Laxman Dewangan | 002945f | 2013-07-09 18:34:22 +0530 | [diff] [blame] | 112 | dev_info(palmas_usb->dev, "USB-HOST cable is detached\n"); |
George Cherian | b7d2d5b | 2013-10-11 00:18:39 +0530 | [diff] [blame] | 113 | } else if ((palmas_usb->linkstat == PALMAS_USB_STATE_DISCONNECT) && |
| 114 | (id_src & PALMAS_USB_ID_INT_SRC_ID_GND)) { |
| 115 | palmas_usb->linkstat = PALMAS_USB_STATE_ID; |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame^] | 116 | extcon_set_cable_state_(edev, EXTCON_USB_HOST, true); |
George Cherian | b7d2d5b | 2013-10-11 00:18:39 +0530 | [diff] [blame] | 117 | dev_info(palmas_usb->dev, " USB-HOST cable is attached\n"); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | return IRQ_HANDLED; |
| 121 | } |
| 122 | |
| 123 | static void palmas_enable_irq(struct palmas_usb *palmas_usb) |
| 124 | { |
| 125 | palmas_write(palmas_usb->palmas, PALMAS_USB_OTG_BASE, |
| 126 | PALMAS_USB_VBUS_CTRL_SET, |
| 127 | PALMAS_USB_VBUS_CTRL_SET_VBUS_ACT_COMP); |
| 128 | |
| 129 | palmas_write(palmas_usb->palmas, PALMAS_USB_OTG_BASE, |
| 130 | PALMAS_USB_ID_CTRL_SET, PALMAS_USB_ID_CTRL_SET_ID_ACT_COMP); |
| 131 | |
| 132 | palmas_write(palmas_usb->palmas, PALMAS_USB_OTG_BASE, |
| 133 | PALMAS_USB_ID_INT_EN_HI_SET, |
Laxman Dewangan | 002945f | 2013-07-09 18:34:22 +0530 | [diff] [blame] | 134 | PALMAS_USB_ID_INT_EN_HI_SET_ID_GND | |
| 135 | PALMAS_USB_ID_INT_EN_HI_SET_ID_FLOAT); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 136 | |
Laxman Dewangan | 7281e05 | 2013-07-10 14:59:06 +0530 | [diff] [blame] | 137 | if (palmas_usb->enable_vbus_detection) |
| 138 | palmas_vbus_irq_handler(palmas_usb->vbus_irq, palmas_usb); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 139 | |
| 140 | /* cold plug for host mode needs this delay */ |
Laxman Dewangan | 7281e05 | 2013-07-10 14:59:06 +0530 | [diff] [blame] | 141 | if (palmas_usb->enable_id_detection) { |
| 142 | msleep(30); |
| 143 | palmas_id_irq_handler(palmas_usb->id_irq, palmas_usb); |
| 144 | } |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | static int palmas_usb_probe(struct platform_device *pdev) |
| 148 | { |
| 149 | struct palmas *palmas = dev_get_drvdata(pdev->dev.parent); |
Jingoo Han | 7c0f6558 | 2013-09-11 13:22:18 +0900 | [diff] [blame] | 150 | struct palmas_usb_platform_data *pdata = dev_get_platdata(&pdev->dev); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 151 | struct device_node *node = pdev->dev.of_node; |
| 152 | struct palmas_usb *palmas_usb; |
| 153 | int status; |
| 154 | |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 155 | palmas_usb = devm_kzalloc(&pdev->dev, sizeof(*palmas_usb), GFP_KERNEL); |
| 156 | if (!palmas_usb) |
| 157 | return -ENOMEM; |
| 158 | |
Laxman Dewangan | 7281e05 | 2013-07-10 14:59:06 +0530 | [diff] [blame] | 159 | if (node && !pdata) { |
| 160 | palmas_usb->wakeup = of_property_read_bool(node, "ti,wakeup"); |
| 161 | palmas_usb->enable_id_detection = of_property_read_bool(node, |
| 162 | "ti,enable-id-detection"); |
| 163 | palmas_usb->enable_vbus_detection = of_property_read_bool(node, |
| 164 | "ti,enable-vbus-detection"); |
| 165 | } else { |
| 166 | palmas_usb->wakeup = true; |
| 167 | palmas_usb->enable_id_detection = true; |
| 168 | palmas_usb->enable_vbus_detection = true; |
| 169 | |
| 170 | if (pdata) |
| 171 | palmas_usb->wakeup = pdata->wakeup; |
| 172 | } |
| 173 | |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 174 | palmas->usb = palmas_usb; |
| 175 | palmas_usb->palmas = palmas; |
| 176 | |
| 177 | palmas_usb->dev = &pdev->dev; |
| 178 | |
| 179 | palmas_usb->id_otg_irq = regmap_irq_get_virq(palmas->irq_data, |
| 180 | PALMAS_ID_OTG_IRQ); |
| 181 | palmas_usb->id_irq = regmap_irq_get_virq(palmas->irq_data, |
| 182 | PALMAS_ID_IRQ); |
| 183 | palmas_usb->vbus_otg_irq = regmap_irq_get_virq(palmas->irq_data, |
| 184 | PALMAS_VBUS_OTG_IRQ); |
| 185 | palmas_usb->vbus_irq = regmap_irq_get_virq(palmas->irq_data, |
| 186 | PALMAS_VBUS_IRQ); |
| 187 | |
Laxman Dewangan | 7281e05 | 2013-07-10 14:59:06 +0530 | [diff] [blame] | 188 | palmas_usb_wakeup(palmas, palmas_usb->wakeup); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 189 | |
| 190 | platform_set_drvdata(pdev, palmas_usb); |
| 191 | |
Chanwoo Choi | 3f79a3f | 2014-04-21 20:44:53 +0900 | [diff] [blame] | 192 | palmas_usb->edev = devm_extcon_dev_allocate(&pdev->dev, |
| 193 | palmas_extcon_cable); |
| 194 | if (IS_ERR(palmas_usb->edev)) { |
| 195 | dev_err(&pdev->dev, "failed to allocate extcon device\n"); |
| 196 | return -ENOMEM; |
| 197 | } |
Chanwoo Choi | 3f79a3f | 2014-04-21 20:44:53 +0900 | [diff] [blame] | 198 | palmas_usb->edev->mutually_exclusive = mutually_exclusive; |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 199 | |
Chanwoo Choi | 3f79a3f | 2014-04-21 20:44:53 +0900 | [diff] [blame] | 200 | status = devm_extcon_dev_register(&pdev->dev, palmas_usb->edev); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 201 | if (status) { |
| 202 | dev_err(&pdev->dev, "failed to register extcon device\n"); |
Chanwoo Choi | 3f79a3f | 2014-04-21 20:44:53 +0900 | [diff] [blame] | 203 | kfree(palmas_usb->edev->name); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 204 | return status; |
| 205 | } |
| 206 | |
Laxman Dewangan | 7281e05 | 2013-07-10 14:59:06 +0530 | [diff] [blame] | 207 | if (palmas_usb->enable_id_detection) { |
| 208 | status = devm_request_threaded_irq(palmas_usb->dev, |
| 209 | palmas_usb->id_irq, |
| 210 | NULL, palmas_id_irq_handler, |
| 211 | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | |
| 212 | IRQF_ONESHOT | IRQF_EARLY_RESUME, |
| 213 | "palmas_usb_id", palmas_usb); |
| 214 | if (status < 0) { |
| 215 | dev_err(&pdev->dev, "can't get IRQ %d, err %d\n", |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 216 | palmas_usb->id_irq, status); |
Chanwoo Choi | 3f79a3f | 2014-04-21 20:44:53 +0900 | [diff] [blame] | 217 | kfree(palmas_usb->edev->name); |
Sangjung Woo | b4dad55 | 2014-04-21 19:10:14 +0900 | [diff] [blame] | 218 | return status; |
Laxman Dewangan | 7281e05 | 2013-07-10 14:59:06 +0530 | [diff] [blame] | 219 | } |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 220 | } |
| 221 | |
Laxman Dewangan | 7281e05 | 2013-07-10 14:59:06 +0530 | [diff] [blame] | 222 | if (palmas_usb->enable_vbus_detection) { |
| 223 | status = devm_request_threaded_irq(palmas_usb->dev, |
| 224 | palmas_usb->vbus_irq, NULL, |
| 225 | palmas_vbus_irq_handler, |
| 226 | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | |
| 227 | IRQF_ONESHOT | IRQF_EARLY_RESUME, |
| 228 | "palmas_usb_vbus", palmas_usb); |
| 229 | if (status < 0) { |
| 230 | dev_err(&pdev->dev, "can't get IRQ %d, err %d\n", |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 231 | palmas_usb->vbus_irq, status); |
Chanwoo Choi | 3f79a3f | 2014-04-21 20:44:53 +0900 | [diff] [blame] | 232 | kfree(palmas_usb->edev->name); |
Sangjung Woo | b4dad55 | 2014-04-21 19:10:14 +0900 | [diff] [blame] | 233 | return status; |
Laxman Dewangan | 7281e05 | 2013-07-10 14:59:06 +0530 | [diff] [blame] | 234 | } |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 235 | } |
| 236 | |
| 237 | palmas_enable_irq(palmas_usb); |
Laxman Dewangan | 024783e | 2013-07-09 18:34:23 +0530 | [diff] [blame] | 238 | device_set_wakeup_capable(&pdev->dev, true); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 239 | return 0; |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | static int palmas_usb_remove(struct platform_device *pdev) |
| 243 | { |
| 244 | struct palmas_usb *palmas_usb = platform_get_drvdata(pdev); |
| 245 | |
Chanwoo Choi | 3f79a3f | 2014-04-21 20:44:53 +0900 | [diff] [blame] | 246 | kfree(palmas_usb->edev->name); |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 247 | |
| 248 | return 0; |
| 249 | } |
| 250 | |
Laxman Dewangan | 024783e | 2013-07-09 18:34:23 +0530 | [diff] [blame] | 251 | #ifdef CONFIG_PM_SLEEP |
| 252 | static int palmas_usb_suspend(struct device *dev) |
| 253 | { |
| 254 | struct palmas_usb *palmas_usb = dev_get_drvdata(dev); |
| 255 | |
| 256 | if (device_may_wakeup(dev)) { |
Laxman Dewangan | 7281e05 | 2013-07-10 14:59:06 +0530 | [diff] [blame] | 257 | if (palmas_usb->enable_vbus_detection) |
| 258 | enable_irq_wake(palmas_usb->vbus_irq); |
| 259 | if (palmas_usb->enable_id_detection) |
| 260 | enable_irq_wake(palmas_usb->id_irq); |
Laxman Dewangan | 024783e | 2013-07-09 18:34:23 +0530 | [diff] [blame] | 261 | } |
| 262 | return 0; |
| 263 | } |
| 264 | |
| 265 | static int palmas_usb_resume(struct device *dev) |
| 266 | { |
| 267 | struct palmas_usb *palmas_usb = dev_get_drvdata(dev); |
| 268 | |
| 269 | if (device_may_wakeup(dev)) { |
Laxman Dewangan | 7281e05 | 2013-07-10 14:59:06 +0530 | [diff] [blame] | 270 | if (palmas_usb->enable_vbus_detection) |
| 271 | disable_irq_wake(palmas_usb->vbus_irq); |
| 272 | if (palmas_usb->enable_id_detection) |
| 273 | disable_irq_wake(palmas_usb->id_irq); |
Laxman Dewangan | 024783e | 2013-07-09 18:34:23 +0530 | [diff] [blame] | 274 | } |
| 275 | return 0; |
| 276 | }; |
| 277 | #endif |
| 278 | |
Jingoo Han | 8d4288f | 2014-02-27 20:36:15 +0900 | [diff] [blame] | 279 | static SIMPLE_DEV_PM_OPS(palmas_pm_ops, palmas_usb_suspend, palmas_usb_resume); |
Laxman Dewangan | 024783e | 2013-07-09 18:34:23 +0530 | [diff] [blame] | 280 | |
Krzysztof Kozlowski | 3bc2ac7 | 2014-05-23 11:03:05 +0200 | [diff] [blame] | 281 | static const struct of_device_id of_palmas_match_tbl[] = { |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 282 | { .compatible = "ti,palmas-usb", }, |
Kishon Vijay Abraham I | 5fbc77d | 2013-10-10 18:07:27 +0530 | [diff] [blame] | 283 | { .compatible = "ti,palmas-usb-vid", }, |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 284 | { .compatible = "ti,twl6035-usb", }, |
Kishon Vijay Abraham I | 5fbc77d | 2013-10-10 18:07:27 +0530 | [diff] [blame] | 285 | { .compatible = "ti,twl6035-usb-vid", }, |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 286 | { /* end */ } |
| 287 | }; |
| 288 | |
| 289 | static struct platform_driver palmas_usb_driver = { |
| 290 | .probe = palmas_usb_probe, |
| 291 | .remove = palmas_usb_remove, |
| 292 | .driver = { |
| 293 | .name = "palmas-usb", |
| 294 | .of_match_table = of_palmas_match_tbl, |
Laxman Dewangan | 024783e | 2013-07-09 18:34:23 +0530 | [diff] [blame] | 295 | .pm = &palmas_pm_ops, |
Graeme Gregory | b1f254e | 2013-05-28 10:50:11 +0900 | [diff] [blame] | 296 | }, |
| 297 | }; |
| 298 | |
| 299 | module_platform_driver(palmas_usb_driver); |
| 300 | |
| 301 | MODULE_ALIAS("platform:palmas-usb"); |
| 302 | MODULE_AUTHOR("Graeme Gregory <gg@slimlogic.co.uk>"); |
| 303 | MODULE_DESCRIPTION("Palmas USB transceiver driver"); |
| 304 | MODULE_LICENSE("GPL"); |
| 305 | MODULE_DEVICE_TABLE(of, of_palmas_match_tbl); |