summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/palmas_gpadc.c
diff options
context:
space:
mode:
authorPatrik Dahlström <risca@dalakolonin.se>2023-04-08 13:48:19 +0200
committerJonathan Cameron <jonathan.cameron@huawei.com>2023-04-13 11:37:21 +0100
commit79d9622d622d49d6c14c51edec2059b8591e7975 (patch)
tree6fdfd60b5da89aeafa52312132891bf6a2a44e5e /drivers/iio/adc/palmas_gpadc.c
parent6d52b0e706989d48e1aa3b5263f6185770ab4af3 (diff)
downloadlwn-79d9622d622d49d6c14c51edec2059b8591e7975.tar.gz
lwn-79d9622d622d49d6c14c51edec2059b8591e7975.zip
iio: adc: palmas: remove adc_wakeupX_data
It does not seem to be used by anyone and later patches in this series are made simpler by first removing this. There is now a lot of dead code that cannot be reached, until later patches revive it. Arguably, this is preferred over removing the code only to add it again. Signed-off-by: Patrik Dahlström <risca@dalakolonin.se> Link: https://lore.kernel.org/r/20230408114825.824505-4-risca@dalakolonin.se Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/palmas_gpadc.c')
-rw-r--r--drivers/iio/adc/palmas_gpadc.c50
1 files changed, 6 insertions, 44 deletions
diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c
index 2921186458e0..03af6cd73ec8 100644
--- a/drivers/iio/adc/palmas_gpadc.c
+++ b/drivers/iio/adc/palmas_gpadc.c
@@ -76,6 +76,12 @@ static struct palmas_gpadc_info palmas_gpadc_info[] = {
PALMAS_ADC_INFO(IN15, 0, 0, 0, 0, INVALID, INVALID, true),
};
+struct palmas_adc_wakeup_property {
+ int adc_channel_number;
+ int adc_high_threshold;
+ int adc_low_threshold;
+};
+
/*
* struct palmas_gpadc - the palmas_gpadc structure
* @ch0_current: channel 0 current source setting
@@ -493,11 +499,6 @@ static int palmas_gpadc_get_adc_dt_data(struct platform_device *pdev,
return 0;
}
-static void palmas_disable_wakeup(void *dev)
-{
- device_wakeup_disable(dev);
-}
-
static int palmas_gpadc_probe(struct platform_device *pdev)
{
struct palmas_gpadc *adc;
@@ -548,36 +549,6 @@ static int palmas_gpadc_probe(struct platform_device *pdev)
return dev_err_probe(adc->dev, ret,
"request irq %d failed\n", adc->irq);
- if (gpadc_pdata->adc_wakeup1_data) {
- memcpy(&adc->wakeup1_data, gpadc_pdata->adc_wakeup1_data,
- sizeof(adc->wakeup1_data));
- adc->wakeup1_enable = true;
- adc->irq_auto_0 = platform_get_irq(pdev, 1);
- ret = devm_request_threaded_irq(&pdev->dev, adc->irq_auto_0,
- NULL, palmas_gpadc_irq_auto,
- IRQF_ONESHOT,
- "palmas-adc-auto-0", adc);
- if (ret < 0)
- return dev_err_probe(adc->dev, ret,
- "request auto0 irq %d failed\n",
- adc->irq_auto_0);
- }
-
- if (gpadc_pdata->adc_wakeup2_data) {
- memcpy(&adc->wakeup2_data, gpadc_pdata->adc_wakeup2_data,
- sizeof(adc->wakeup2_data));
- adc->wakeup2_enable = true;
- adc->irq_auto_1 = platform_get_irq(pdev, 2);
- ret = devm_request_threaded_irq(&pdev->dev, adc->irq_auto_1,
- NULL, palmas_gpadc_irq_auto,
- IRQF_ONESHOT,
- "palmas-adc-auto-1", adc);
- if (ret < 0)
- return dev_err_probe(adc->dev, ret,
- "request auto1 irq %d failed\n",
- adc->irq_auto_1);
- }
-
/* set the current source 0 (value 0/5/15/20 uA => 0..3) */
if (gpadc_pdata->ch0_current <= 1)
adc->ch0_current = PALMAS_ADC_CH0_CURRENT_SRC_0;
@@ -617,15 +588,6 @@ static int palmas_gpadc_probe(struct platform_device *pdev)
palmas_gpadc_calibrate(adc, i);
}
- if (adc->wakeup1_enable || adc->wakeup2_enable) {
- device_wakeup_enable(&pdev->dev);
- ret = devm_add_action_or_reset(&pdev->dev,
- palmas_disable_wakeup,
- &pdev->dev);
- if (ret)
- return ret;
- }
-
return 0;
}