Message ID | 20230402164247.3089146-2-risca@dalakolonin.se |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1827078vqo; Sun, 2 Apr 2023 09:44:21 -0700 (PDT) X-Google-Smtp-Source: AKy350ZBiwG0Z7rx6CrcuOib8D/zmRlCcUwlkSzp5PH/ozPHZf/nTuqfim2rGWShh07eFYdOaXVJ X-Received: by 2002:a05:6a21:99aa:b0:d9:1fa9:c59a with SMTP id ve42-20020a056a2199aa00b000d91fa9c59amr16566408pzb.8.1680453861049; Sun, 02 Apr 2023 09:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680453861; cv=none; d=google.com; s=arc-20160816; b=z2PhS0fXcsVjqVmfBomeLi36SV4XwTbg20IKHqkWdi+3da45ik0YrRhtFXR2bzjBZ4 zxeC7MfuscnFfDb5XAOBVT2S4/1WllFMChII3wP6AszIuaT2cKo59zgHrZD2k5QEX1gr R1oN6Juknt8qxzUCWzQigSo0+kg591tIQtkHI7MNV8yHJ2VuvR6GotY6GRhiF7BVnJLO rgxLFaNWZONm7zxIIH5meQmndOcwlbYAROKwwvPLiVPYcXtMEGGcI8YVNztA0c2huej4 Z8VSOdJVoDtDc+TV/Bgwc9Z6yb9i5Ui66QmQC2sbSaJIdlsJTYI4c1hCdNFC5nTSNchv bplw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=rPuSfZ0YQ8EW/e9OiW3VYvpUsYmDhJpLHIhD8HkVNo0=; b=qxPVAw3uxb7DTftL7UKO/F0TCBbmq/3Saq9SgkA5aYyE3McOKNtJQ9ubuqRT0RQWj6 9I+R9WPHUckjHdbIIyazNiJv2CSx3dtN7AtXauIs/EKK1dfJhJEEIWWOgNh8F3c5n0LO W8al8SyGjKvMGo+amgGsAf/0bf8nsQr/It3iEiGHBAhk3e9+R5ny/iOAqfQzSKzeE20T WS4OrZS+fBIchznbHcyJEvFt+B+pvvEEPcpbYskH2U9LNaOaMI3s0lbRrKxSKhoF11w6 SqVIkPHoBKY57idQTxUsslJFY5HAd+nAnC6thwy/9fZe01SRSLUGUgQtCrJLbflGDiIk PovA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dalakolonin.se header.s=D374B428-D0A7-11ED-A657-75977B426508 header.b="Kjt9vBt/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dalakolonin.se Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y63-20020a638a42000000b00513af1acc5fsi6964666pgd.483.2023.04.02.09.44.07; Sun, 02 Apr 2023 09:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dalakolonin.se header.s=D374B428-D0A7-11ED-A657-75977B426508 header.b="Kjt9vBt/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dalakolonin.se Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231171AbjDBQnd (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Sun, 2 Apr 2023 12:43:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230478AbjDBQn2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 2 Apr 2023 12:43:28 -0400 Received: from pio-pvt-msa1.bahnhof.se (pio-pvt-msa1.bahnhof.se [79.136.2.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A03FFE3B6; Sun, 2 Apr 2023 09:43:24 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa1.bahnhof.se (Postfix) with ESMTP id C86333FC16; Sun, 2 Apr 2023 18:43:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Score: -2.1 X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Authentication-Results: pio-pvt-msa1.bahnhof.se (amavisd-new); dkim=pass (2048-bit key) header.d=dalakolonin.se Received: from pio-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bcwTJN0kyz-3; Sun, 2 Apr 2023 18:43:22 +0200 (CEST) Received: by pio-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id E63843F2DE; Sun, 2 Apr 2023 18:43:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.dalakolonin.se (Postfix) with ESMTP id 65BF8937A6; Sun, 2 Apr 2023 16:43:20 +0000 (UTC) Received: from zimbra.dalakolonin.se ([127.0.0.1]) by localhost (zimbra.dalakolonin.se [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 4l0jFikNRAVt; Sun, 2 Apr 2023 16:43:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.dalakolonin.se (Postfix) with ESMTP id 52B5A93776; Sun, 2 Apr 2023 16:43:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra.dalakolonin.se 52B5A93776 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dalakolonin.se; s=D374B428-D0A7-11ED-A657-75977B426508; t=1680453796; bh=rPuSfZ0YQ8EW/e9OiW3VYvpUsYmDhJpLHIhD8HkVNo0=; h=From:To:Date:Message-Id:MIME-Version; b=Kjt9vBt/+c2GReEUBjpDi+Hjv+Fnodb37tBZmvrd9NN2QKKNT9LUmhWHE8UfO8qRF ZOTK1fjMrGhsro8eafwuvZimzMH/6RCN5DQ0wfcsVCTY0VkklJMfgUovO3tpGMxh// DtDiN//oIlK+iXHA8h8WPivBT4s/QcXT322gr6U8h4AszOIBZy4/j61VDybWp/Gh6l gJWrgcDOYXqDUELHtq9Py1LSHDnwRK1GO0N7v/gvsjFtmk8JdxboXADK/i6FBONrk7 xi4Z9k8pWCUBvJoVzq35V99To0LBsSi1RGQBAxthR/zRTpQy3jcaJIZ+OnDTLaLCPH Wkll6SuUSSJcw== X-Virus-Scanned: amavisd-new at dalakolonin.se Received: from zimbra.dalakolonin.se ([127.0.0.1]) by localhost (zimbra.dalakolonin.se [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aLgttvtyumkf; Sun, 2 Apr 2023 16:43:16 +0000 (UTC) Received: from rack-server-1.dalakolonin.se (unknown [172.17.0.1]) by zimbra.dalakolonin.se (Postfix) with ESMTPSA id 16FDD93773; Sun, 2 Apr 2023 16:43:16 +0000 (UTC) From: =?utf-8?q?Patrik_Dahlstr=C3=B6m?= <risca@dalakolonin.se> To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, pgoudagunta@nvidia.com, hns@goldelico.com, jic23@kernel.org, lars@metafoo.de, linux-omap@vger.kernel.org, =?utf-8?q?Pa?= =?utf-8?q?trik_Dahlstr=C3=B6m?= <risca@dalakolonin.se> Subject: [PATCH v2 1/7] iio: adc: palmas: remove adc_wakeupX_data Date: Sun, 2 Apr 2023 18:42:41 +0200 Message-Id: <20230402164247.3089146-2-risca@dalakolonin.se> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230402164247.3089146-1-risca@dalakolonin.se> References: <20230402164247.3089146-1-risca@dalakolonin.se> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762083587923002370?= X-GMAIL-MSGID: =?utf-8?q?1762083587923002370?= |
Series |
iio: adc: palmas_gpadc: add iio events
|
|
Commit Message
Patrik Dahlström
April 2, 2023, 4:42 p.m. UTC
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>
---
drivers/iio/adc/palmas_gpadc.c | 50 ++++------------------------------
include/linux/mfd/palmas.h | 8 ------
2 files changed, 6 insertions(+), 52 deletions(-)
Comments
Hi Patrik, > Am 02.04.2023 um 18:42 schrieb Patrik Dahlström <risca@dalakolonin.se>: > > 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> > --- > drivers/iio/adc/palmas_gpadc.c | 50 ++++------------------------------ > include/linux/mfd/palmas.h | 8 ------ > 2 files changed, 6 insertions(+), 52 deletions(-) > > diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c > index 24d7c096e4b8..943ac579eb1f 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 > @@ -492,11 +498,6 @@ static int palmas_gpadc_get_adc_dt_data(struct platform_device *pdev, > return 0; > } > > -static void palmas_disable_wakeup(void *dev) something seems to be mixed up here. There is no palmas_disable_wakeup() upstream that can be removed. So this patch can not be applied as 1/7 to any upstream kernel. Please rebase your series on either linus/master or linux-next/master. BR, Nikolaus > -{ > - device_wakeup_disable(dev); > -} > - > static int palmas_gpadc_probe(struct platform_device *pdev) > { > struct palmas_gpadc *adc; > @@ -547,36 +548,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; > @@ -616,15 +587,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; > } > > diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h > index 1e61c7e9f50d..55f22adb1a9e 100644 > --- a/include/linux/mfd/palmas.h > +++ b/include/linux/mfd/palmas.h > @@ -129,12 +129,6 @@ struct palmas_pmic_driver_data { > struct regulator_config config); > }; > > -struct palmas_adc_wakeup_property { > - int adc_channel_number; > - int adc_high_threshold; > - int adc_low_threshold; > -}; > - > struct palmas_gpadc_platform_data { > /* Channel 3 current source is only enabled during conversion */ > int ch3_current; /* 0: off; 1: 10uA; 2: 400uA; 3: 800 uA */ > @@ -153,8 +147,6 @@ struct palmas_gpadc_platform_data { > int start_polarity; > > int auto_conversion_period_ms; > - struct palmas_adc_wakeup_property *adc_wakeup1_data; > - struct palmas_adc_wakeup_property *adc_wakeup2_data; > }; > > struct palmas_reg_init { > -- > 2.25.1 >
On Mon, Apr 03, 2023 at 06:49:36PM +0200, H. Nikolaus Schaller wrote: > Hi Patrik, > > > Am 02.04.2023 um 18:42 schrieb Patrik Dahlström <risca@dalakolonin.se>: > > > > 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> > > --- > > drivers/iio/adc/palmas_gpadc.c | 50 ++++------------------------------ > > include/linux/mfd/palmas.h | 8 ------ > > 2 files changed, 6 insertions(+), 52 deletions(-) > > > > diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c > > index 24d7c096e4b8..943ac579eb1f 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 > > @@ -492,11 +498,6 @@ static int palmas_gpadc_get_adc_dt_data(struct platform_device *pdev, > > return 0; > > } > > > > -static void palmas_disable_wakeup(void *dev) > > something seems to be mixed up here. > > There is no palmas_disable_wakeup() upstream that can be removed. So this patch > can not be applied as 1/7 to any upstream kernel. > > Please rebase your series on either linus/master or linux-next/master. I'm sorry for the confusion. I should have been more clear in the cover letter. This series is based on Jonathan Cameron's iio tree[1], plus the patches at [2] and [3]. The first patch is already part of linux-next and I was under the impression that [3] would be soon too. Would it be best to rebase this series on linux-next instead? [1] git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git [2] https://patchwork.kernel.org/project/linux-iio/patch/20230313205029.1881745-1-risca@dalakolonin.se/ [3] https://patchwork.kernel.org/project/linux-iio/patch/20230318163039.56115-1-jic23@kernel.org/ > > BR, > Nikolaus > > > -{ > > - device_wakeup_disable(dev); > > -} > > - > > static int palmas_gpadc_probe(struct platform_device *pdev) > > { > > struct palmas_gpadc *adc; > > @@ -547,36 +548,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; > > @@ -616,15 +587,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; > > } > > > > diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h > > index 1e61c7e9f50d..55f22adb1a9e 100644 > > --- a/include/linux/mfd/palmas.h > > +++ b/include/linux/mfd/palmas.h > > @@ -129,12 +129,6 @@ struct palmas_pmic_driver_data { > > struct regulator_config config); > > }; > > > > -struct palmas_adc_wakeup_property { > > - int adc_channel_number; > > - int adc_high_threshold; > > - int adc_low_threshold; > > -}; > > - > > struct palmas_gpadc_platform_data { > > /* Channel 3 current source is only enabled during conversion */ > > int ch3_current; /* 0: off; 1: 10uA; 2: 400uA; 3: 800 uA */ > > @@ -153,8 +147,6 @@ struct palmas_gpadc_platform_data { > > int start_polarity; > > > > int auto_conversion_period_ms; > > - struct palmas_adc_wakeup_property *adc_wakeup1_data; > > - struct palmas_adc_wakeup_property *adc_wakeup2_data; > > }; > > > > struct palmas_reg_init { > > -- > > 2.25.1 > > >
On Tue, 4 Apr 2023 12:33:28 +0200 Patrik Dahlström <risca@dalakolonin.se> wrote: > On Mon, Apr 03, 2023 at 06:49:36PM +0200, H. Nikolaus Schaller wrote: > > Hi Patrik, > > > > > Am 02.04.2023 um 18:42 schrieb Patrik Dahlström <risca@dalakolonin.se>: > > > > > > 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> > > > --- > > > drivers/iio/adc/palmas_gpadc.c | 50 ++++------------------------------ > > > include/linux/mfd/palmas.h | 8 ------ > > > 2 files changed, 6 insertions(+), 52 deletions(-) > > > > > > diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c > > > index 24d7c096e4b8..943ac579eb1f 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 > > > @@ -492,11 +498,6 @@ static int palmas_gpadc_get_adc_dt_data(struct platform_device *pdev, > > > return 0; > > > } > > > > > > -static void palmas_disable_wakeup(void *dev) > > > > something seems to be mixed up here. > > > > There is no palmas_disable_wakeup() upstream that can be removed. So this patch > > can not be applied as 1/7 to any upstream kernel. > > > > Please rebase your series on either linus/master or linux-next/master. > > I'm sorry for the confusion. I should have been more clear in the cover > letter. > > This series is based on Jonathan Cameron's iio tree[1], plus the patches at > [2] and [3]. The first patch is already part of linux-next and I was under > the impression that [3] would be soon too. > > Would it be best to rebase this series on linux-next instead? > > [1] git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git > [2] https://patchwork.kernel.org/project/linux-iio/patch/20230313205029.1881745-1-risca@dalakolonin.se/ > [3] https://patchwork.kernel.org/project/linux-iio/patch/20230318163039.56115-1-jic23@kernel.org/ > This gets a bit complex because we have a mixture of fixes and updates and the desire to end up with a fairly simple history in git. Before [3] can be applied I need to move the togreg tree base to incorporate a newer version of char-misc/char-misc-next (which is the upstream for IIO pull requests) and the fix to have made the round trip to get there (which hasn't happened yet). At that point I'll pick up the above and your series will be on top of that. So you were fine to base this patch as you did, but you should make sure the cover letter calls out the required patches that haven't yet made it upstream. I generally don't mind simple cases of needing to rebase if things are based on rc1 (don't every use linux-next as it is not a stable base) whilst applying but in this case the devm change is sufficiently fiddly that you have two obvious choices. 1) Just add it to the start of your patch set (I'm fine with people doing that with anything I post). 2) Listing the patches that should be applied first in the cover letter. Jonathan > > > > BR, > > Nikolaus > > > > > -{ > > > - device_wakeup_disable(dev); > > > -} > > > - > > > static int palmas_gpadc_probe(struct platform_device *pdev) > > > { > > > struct palmas_gpadc *adc; > > > @@ -547,36 +548,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; > > > @@ -616,15 +587,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; > > > } > > > > > > diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h > > > index 1e61c7e9f50d..55f22adb1a9e 100644 > > > --- a/include/linux/mfd/palmas.h > > > +++ b/include/linux/mfd/palmas.h > > > @@ -129,12 +129,6 @@ struct palmas_pmic_driver_data { > > > struct regulator_config config); > > > }; > > > > > > -struct palmas_adc_wakeup_property { > > > - int adc_channel_number; > > > - int adc_high_threshold; > > > - int adc_low_threshold; > > > -}; > > > - > > > struct palmas_gpadc_platform_data { > > > /* Channel 3 current source is only enabled during conversion */ > > > int ch3_current; /* 0: off; 1: 10uA; 2: 400uA; 3: 800 uA */ > > > @@ -153,8 +147,6 @@ struct palmas_gpadc_platform_data { > > > int start_polarity; > > > > > > int auto_conversion_period_ms; > > > - struct palmas_adc_wakeup_property *adc_wakeup1_data; > > > - struct palmas_adc_wakeup_property *adc_wakeup2_data; > > > }; > > > > > > struct palmas_reg_init { > > > -- > > > 2.25.1 > > > > >
diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c index 24d7c096e4b8..943ac579eb1f 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 @@ -492,11 +498,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; @@ -547,36 +548,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; @@ -616,15 +587,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; } diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 1e61c7e9f50d..55f22adb1a9e 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h @@ -129,12 +129,6 @@ struct palmas_pmic_driver_data { struct regulator_config config); }; -struct palmas_adc_wakeup_property { - int adc_channel_number; - int adc_high_threshold; - int adc_low_threshold; -}; - struct palmas_gpadc_platform_data { /* Channel 3 current source is only enabled during conversion */ int ch3_current; /* 0: off; 1: 10uA; 2: 400uA; 3: 800 uA */ @@ -153,8 +147,6 @@ struct palmas_gpadc_platform_data { int start_polarity; int auto_conversion_period_ms; - struct palmas_adc_wakeup_property *adc_wakeup1_data; - struct palmas_adc_wakeup_property *adc_wakeup2_data; }; struct palmas_reg_init {