summaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-axp288.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-12-30 11:04:13 -0500
committerChanwoo Choi <cw00.choi@samsung.com>2018-01-02 20:11:02 -0500
commit9bf317e900a19a857eb9921c9441a92e89f40415 (patch)
treebdc42b55d9219827a77af9430c4a6378ea6227b8 /drivers/extcon/extcon-axp288.c
parent10887fb0dbba483dd588f20e2929372093d49a69 (diff)
extcon: axp288: Remove unused platform data
This is not used / set anywhere in the tree. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon-axp288.c')
-rw-r--r--drivers/extcon/extcon-axp288.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index 3bd27ebe2736..1621f2f7f129 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -24,8 +24,6 @@
24#include <linux/notifier.h> 24#include <linux/notifier.h>
25#include <linux/extcon-provider.h> 25#include <linux/extcon-provider.h>
26#include <linux/regmap.h> 26#include <linux/regmap.h>
27#include <linux/gpio.h>
28#include <linux/gpio/consumer.h>
29#include <linux/mfd/axp20x.h> 27#include <linux/mfd/axp20x.h>
30 28
31/* Power source status register */ 29/* Power source status register */
@@ -79,11 +77,6 @@ enum axp288_extcon_reg {
79 AXP288_BC_DET_STAT_REG = 0x2f, 77 AXP288_BC_DET_STAT_REG = 0x2f,
80}; 78};
81 79
82enum axp288_mux_select {
83 EXTCON_GPIO_MUX_SEL_PMIC = 0,
84 EXTCON_GPIO_MUX_SEL_SOC,
85};
86
87enum axp288_extcon_irq { 80enum axp288_extcon_irq {
88 VBUS_FALLING_IRQ = 0, 81 VBUS_FALLING_IRQ = 0,
89 VBUS_RISING_IRQ, 82 VBUS_RISING_IRQ,
@@ -104,7 +97,6 @@ struct axp288_extcon_info {
104 struct device *dev; 97 struct device *dev;
105 struct regmap *regmap; 98 struct regmap *regmap;
106 struct regmap_irq_chip_data *regmap_irqc; 99 struct regmap_irq_chip_data *regmap_irqc;
107 struct gpio_desc *gpio_mux_cntl;
108 int irq[EXTCON_IRQ_END]; 100 int irq[EXTCON_IRQ_END];
109 struct extcon_dev *edev; 101 struct extcon_dev *edev;
110 unsigned int previous_cable; 102 unsigned int previous_cable;
@@ -196,15 +188,6 @@ static int axp288_handle_chrg_det_event(struct axp288_extcon_info *info)
196 } 188 }
197 189
198no_vbus: 190no_vbus:
199 /*
200 * If VBUS is absent Connect D+/D- lines to PMIC for BC
201 * detection. Else connect them to SOC for USB communication.
202 */
203 if (info->gpio_mux_cntl)
204 gpiod_set_value(info->gpio_mux_cntl,
205 vbus_attach ? EXTCON_GPIO_MUX_SEL_SOC
206 : EXTCON_GPIO_MUX_SEL_PMIC);
207
208 extcon_set_state_sync(info->edev, info->previous_cable, false); 191 extcon_set_state_sync(info->edev, info->previous_cable, false);
209 if (info->previous_cable == EXTCON_CHG_USB_SDP) 192 if (info->previous_cable == EXTCON_CHG_USB_SDP)
210 extcon_set_state_sync(info->edev, EXTCON_USB, false); 193 extcon_set_state_sync(info->edev, EXTCON_USB, false);
@@ -252,8 +235,7 @@ static int axp288_extcon_probe(struct platform_device *pdev)
252{ 235{
253 struct axp288_extcon_info *info; 236 struct axp288_extcon_info *info;
254 struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); 237 struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
255 struct axp288_extcon_pdata *pdata = pdev->dev.platform_data; 238 int ret, i, pirq;
256 int ret, i, pirq, gpio;
257 239
258 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); 240 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
259 if (!info) 241 if (!info)
@@ -263,8 +245,6 @@ static int axp288_extcon_probe(struct platform_device *pdev)
263 info->regmap = axp20x->regmap; 245 info->regmap = axp20x->regmap;
264 info->regmap_irqc = axp20x->regmap_irqc; 246 info->regmap_irqc = axp20x->regmap_irqc;
265 info->previous_cable = EXTCON_NONE; 247 info->previous_cable = EXTCON_NONE;
266 if (pdata)
267 info->gpio_mux_cntl = pdata->gpio_mux_cntl;
268 248
269 platform_set_drvdata(pdev, info); 249 platform_set_drvdata(pdev, info);
270 250
@@ -285,19 +265,6 @@ static int axp288_extcon_probe(struct platform_device *pdev)
285 return ret; 265 return ret;
286 } 266 }
287 267
288 /* Set up gpio control for USB Mux */
289 if (info->gpio_mux_cntl) {
290 gpio = desc_to_gpio(info->gpio_mux_cntl);
291 ret = devm_gpio_request(&pdev->dev, gpio, "USB_MUX");
292 if (ret < 0) {
293 dev_err(&pdev->dev,
294 "failed to request the gpio=%d\n", gpio);
295 return ret;
296 }
297 gpiod_direction_output(info->gpio_mux_cntl,
298 EXTCON_GPIO_MUX_SEL_PMIC);
299 }
300
301 for (i = 0; i < EXTCON_IRQ_END; i++) { 268 for (i = 0; i < EXTCON_IRQ_END; i++) {
302 pirq = platform_get_irq(pdev, i); 269 pirq = platform_get_irq(pdev, i);
303 if (pirq < 0) 270 if (pirq < 0)