From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72E16EA4 for ; Tue, 21 Jun 2022 09:25:54 +0000 (UTC) Received: by mail-ej1-f46.google.com with SMTP id lw20so3826830ejb.4 for ; Tue, 21 Jun 2022 02:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NOMsJgOH3MiCNjts6Vy2cOyGVGYl5lD+qutJwwCIfsM=; b=U4TmMXAVNZeGSibLS1ghJJrIiOQVgWj4Qhzr2zXpZ+UjaA8vQDXSqrB0mhffAZ6Y9d XaJxAG/q3qhi8lBbjSlIe4BCARpAkrbeLvmp7yJ8wuR7IahJDrPRtLyghlHUZlUs4nWB FZTWmbA6jN6Dl+1dTCiUI5xSy7dHbNcZ9mHyH7xWZpPiLD4CjNeKT3bkajbgNmUNGssT 58FkgHEVrYlyPbFS9MvU+nFY1iGFJ3jlS3X3KFvPTYe8GBn4g2yDEArJsar8PRNVwU3S TIAQj0k8aL5a3We6gBozjvqbKtUmm2XGgOixTPoPN+2bY4+KThPsVwTq4sbr78gBo2r6 edBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NOMsJgOH3MiCNjts6Vy2cOyGVGYl5lD+qutJwwCIfsM=; b=icqyuyXQYR+yfu3dqQ7x10fzEE/k+4QYXxFhhIwXLXJqkXTRXtrR5gqR3heuUnL7Jn hGaaXh3tX781vOFXez4QgcKiHi6EtJA+IRaYHDhaXADwMnsZScossUrNvQqwgLIXr727 v8lZwG0e2N2uwlCJaW+oJ0qVZ3/aOxbANDIri0lrbgieHfDQBC4bUvHi3B7wr4/+vpQH /jxKLsvLBNTNMT+AE2xK9hyk/1qXyIthH/tZBZRea0U7tT3i3+DqQ389CBmNaBzOnI9U xh5SAscnHfSanixOiT30LwVI+YgaHPUKATirzlgyJWdQ695BFrhA/8rPdbVRG/+sC0Qh 8n8w== X-Gm-Message-State: AJIora+nCbl7n6LZOUvUOC29HUI1i0pD6nZf4XTJEDlW7kySLsDFBavo Xs/Dt//+w9nxqnaffU8++s2OE0fgEtD1fm75/SA= X-Google-Smtp-Source: AGRyM1se8Q5QQtyQhqZ276ze+sQZWIHL5X2Uisw4LahZgr/oEQb+koeaLdBeR+uqRMsLqk/klYDHMQOlZMtTnGjBf6c= X-Received: by 2002:a17:907:72c7:b0:722:e5af:f666 with SMTP id du7-20020a17090772c700b00722e5aff666mr1241803ejc.44.1655803552679; Tue, 21 Jun 2022 02:25:52 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220620200644.1961936-1-aidanmacdonald.0x0@gmail.com> In-Reply-To: <20220620200644.1961936-1-aidanmacdonald.0x0@gmail.com> From: Andy Shevchenko Date: Tue, 21 Jun 2022 11:25:16 +0200 Message-ID: Subject: Re: [PATCH 00/49] regmap-irq cleanups and refactoring To: Aidan MacDonald Cc: Mark Brown , Andy Gross , Bjorn Andersson , Srinivas Kandagatla , Banajit Goswami , Greg Kroah-Hartman , "Rafael J. Wysocki" , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , MyungJoo Ham , Michael Walle , Linus Walleij , Bartosz Golaszewski , Thomas Gleixner , Marc Zyngier , Lee Jones , Manivannan Sadhasivam , Cristian Ciocaltea , Chen-Yu Tsai , tharvey@gateworks.com, rjones@gateworks.com, Matti Vaittinen , orsonzhai@gmail.com, baolin.wang7@gmail.com, zhang.lyra@gmail.com, Jernej Skrabec , Samuel Holland , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , linux-actions@lists.infradead.org, linux-arm-msm , linux-arm Mailing List , linux-sunxi@lists.linux.dev, ALSA Development Mailing List Content-Type: text/plain; charset="UTF-8" On Mon, Jun 20, 2022 at 10:07 PM Aidan MacDonald wrote: > > Hi Mark, > > Here's a bunch of cleanups for regmap-irq focused on simplifying the API > and generalizing it a bit. It's broken up into three refactors, focusing > on one area at a time. > > * Patches 01 and 02 are straightforward bugfixes, independent of the > rest of the series. Neither of the bugs are triggered by in-tree > drivers but they might be worth picking up early anyhow. > > * Patches 03-13 clean up everything related to configuring IRQ types. > > * Patches 14-45 deal with mask/unmask registers. First, make unmask > registers behave more intuitively and usefully, and get rid of the > mask_invert flag in favor of describing inverted mask registers as > unmask registers. Second, make the mask_writeonly flag more useful > and enable it for two chips where it makes sense. > > * Patches 46-49 refactor sub_irq_reg() as a get_irq_reg() callback, > and use that to eliminate the not_fixed_stride flag. > > The approach I used when refactoring is pretty simple: (1) introduce new > functionality in regmap-irq, (2) convert the drivers, and (3) remove any > old code. Nothing should break in the middle. > > The patches can be re-ordered to some extent if that's preferable, but > it's best to add get_irq_reg() last to avoid having to think about how > it interacts with features that'll be removed anyway. > > I can't test most of the devices affected by this series so a lot of the > code is only build tested. I've tested on real hardware with my AXP192 > patchset[1], although it only provides limited code coverage. > > qcom-pm8008 in particular deserves careful testing - it used all of the > features touched by the refactors and required the most changes. Other > drivers only required trivial changes but there are three of them worth > mentioning: wcd943x, wcd9335, and wcd938x. They have suspicious looking > IRQ type definitions and I'm pretty sure aren't working properly, but > I can't fix them myself. The refactor shouldn't affect their behavior > so how / when / if they get fixed shouldn't be much of an issue. > > Oh, and I added the 'mask_writeonly' flag and volatile ranges to the > stpmic1 driver based on its datasheet[2] as a small optimization. It's > probably fine but testing would be a good idea. > > [1]: https://lore.kernel.org/linux-iio/20220618214009.2178567-1-aidanmacdonald.0x0@gmailcom/ > [2]: https://www.st.com/resource/en/datasheet/stpmic1.pdf Cool series, thanks for cleaning this up! -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB70CC43334 for ; Tue, 21 Jun 2022 09:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pzLTWyR4CIAqGCqm/BgxnSsC95f767spDl5vb8aHrdI=; b=fa6kIcOaNp7Qbl q5E+qPj5Ky6oNP5xeHvoU46trJRf/JSNFEORXkRPQwlExdHtOCKVrdDhGeYcCNcS241Lbq3hBwxT1 TMz4MEelsuxsRJ1axZNzJlhxMe2w9E7rARnIl9w+ljVYPnRGYcBB2NLjeZUPnZ5CVrZzD8+bqT3WO fySLeLxrxMM73x/Ll6T2gynpn1qJ2ypGNVnv0yfX9kyizbftlYSCvglgIq/o1JNFoZAPPkfB7tq5M 4LMfeT6Ax9Q2dXVlB4lVf7Hl0g3TR2XJ7ZScSHo5AtpzHYwL/4H8qYlxFvzQZeSZqk4DqzRzAeFZy Gxr1k3TG6KWnHaqjZ+Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3a92-004cSk-75; Tue, 21 Jun 2022 09:26:00 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3a8y-004cRR-FT; Tue, 21 Jun 2022 09:25:58 +0000 Received: by mail-ej1-x634.google.com with SMTP id ay16so6790987ejb.6; Tue, 21 Jun 2022 02:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NOMsJgOH3MiCNjts6Vy2cOyGVGYl5lD+qutJwwCIfsM=; b=U4TmMXAVNZeGSibLS1ghJJrIiOQVgWj4Qhzr2zXpZ+UjaA8vQDXSqrB0mhffAZ6Y9d XaJxAG/q3qhi8lBbjSlIe4BCARpAkrbeLvmp7yJ8wuR7IahJDrPRtLyghlHUZlUs4nWB FZTWmbA6jN6Dl+1dTCiUI5xSy7dHbNcZ9mHyH7xWZpPiLD4CjNeKT3bkajbgNmUNGssT 58FkgHEVrYlyPbFS9MvU+nFY1iGFJ3jlS3X3KFvPTYe8GBn4g2yDEArJsar8PRNVwU3S TIAQj0k8aL5a3We6gBozjvqbKtUmm2XGgOixTPoPN+2bY4+KThPsVwTq4sbr78gBo2r6 edBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NOMsJgOH3MiCNjts6Vy2cOyGVGYl5lD+qutJwwCIfsM=; b=GHZUyezIQ2qZbfV4AD8ifvpadYMlVh2Kvip7PRbrwSyYhhsuPVX6HPJ2CMj6J77SFB +A8eWjJEAnF9l1dT19ZQJmke5ke7LMyFlbjW4ANQPR/I13uhZP8SMLqdkBbGeH10SFbC kc41TRm4BlpYPANlUO9sJ4ocvrLEwmNWgX2d5AtlQINFQ4a3ckLYB/q8H/8bCyptX0fg sN/2gHfdOgyVlBcHziMiATHwtsgJkui15nQ4VHlziFbQ5uueOrDSABgzhEoMyLRLuxgk xFRmwk2DsiFciPUuSU3Js2O4uzJVtpFU9F6OOuYsp4+pcAZ3mFawEN6pLvfirKy+tsEX OIOw== X-Gm-Message-State: AJIora+yUUORq+Pfk55Ld5Ypd0VVDuBRam2LR5/3DMc/+qpdxq6ecdZG GasomiyBpl/0/KTG/IW4Z83dTzCuGsCfGnWAh9U= X-Google-Smtp-Source: AGRyM1se8Q5QQtyQhqZ276ze+sQZWIHL5X2Uisw4LahZgr/oEQb+koeaLdBeR+uqRMsLqk/klYDHMQOlZMtTnGjBf6c= X-Received: by 2002:a17:907:72c7:b0:722:e5af:f666 with SMTP id du7-20020a17090772c700b00722e5aff666mr1241803ejc.44.1655803552679; Tue, 21 Jun 2022 02:25:52 -0700 (PDT) MIME-Version: 1.0 References: <20220620200644.1961936-1-aidanmacdonald.0x0@gmail.com> In-Reply-To: <20220620200644.1961936-1-aidanmacdonald.0x0@gmail.com> From: Andy Shevchenko Date: Tue, 21 Jun 2022 11:25:16 +0200 Message-ID: Subject: Re: [PATCH 00/49] regmap-irq cleanups and refactoring To: Aidan MacDonald Cc: Mark Brown , Andy Gross , Bjorn Andersson , Srinivas Kandagatla , Banajit Goswami , Greg Kroah-Hartman , "Rafael J. Wysocki" , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , MyungJoo Ham , Michael Walle , Linus Walleij , Bartosz Golaszewski , Thomas Gleixner , Marc Zyngier , Lee Jones , Manivannan Sadhasivam , Cristian Ciocaltea , Chen-Yu Tsai , tharvey@gateworks.com, rjones@gateworks.com, Matti Vaittinen , orsonzhai@gmail.com, baolin.wang7@gmail.com, zhang.lyra@gmail.com, Jernej Skrabec , Samuel Holland , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , linux-actions@lists.infradead.org, linux-arm-msm , linux-arm Mailing List , linux-sunxi@lists.linux.dev, ALSA Development Mailing List X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220621_022556_564188_28DEF047 X-CRM114-Status: GOOD ( 30.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 20, 2022 at 10:07 PM Aidan MacDonald wrote: > > Hi Mark, > > Here's a bunch of cleanups for regmap-irq focused on simplifying the API > and generalizing it a bit. It's broken up into three refactors, focusing > on one area at a time. > > * Patches 01 and 02 are straightforward bugfixes, independent of the > rest of the series. Neither of the bugs are triggered by in-tree > drivers but they might be worth picking up early anyhow. > > * Patches 03-13 clean up everything related to configuring IRQ types. > > * Patches 14-45 deal with mask/unmask registers. First, make unmask > registers behave more intuitively and usefully, and get rid of the > mask_invert flag in favor of describing inverted mask registers as > unmask registers. Second, make the mask_writeonly flag more useful > and enable it for two chips where it makes sense. > > * Patches 46-49 refactor sub_irq_reg() as a get_irq_reg() callback, > and use that to eliminate the not_fixed_stride flag. > > The approach I used when refactoring is pretty simple: (1) introduce new > functionality in regmap-irq, (2) convert the drivers, and (3) remove any > old code. Nothing should break in the middle. > > The patches can be re-ordered to some extent if that's preferable, but > it's best to add get_irq_reg() last to avoid having to think about how > it interacts with features that'll be removed anyway. > > I can't test most of the devices affected by this series so a lot of the > code is only build tested. I've tested on real hardware with my AXP192 > patchset[1], although it only provides limited code coverage. > > qcom-pm8008 in particular deserves careful testing - it used all of the > features touched by the refactors and required the most changes. Other > drivers only required trivial changes but there are three of them worth > mentioning: wcd943x, wcd9335, and wcd938x. They have suspicious looking > IRQ type definitions and I'm pretty sure aren't working properly, but > I can't fix them myself. The refactor shouldn't affect their behavior > so how / when / if they get fixed shouldn't be much of an issue. > > Oh, and I added the 'mask_writeonly' flag and volatile ranges to the > stpmic1 driver based on its datasheet[2] as a small optimization. It's > probably fine but testing would be a good idea. > > [1]: https://lore.kernel.org/linux-iio/20220618214009.2178567-1-aidanmacdonald.0x0@gmailcom/ > [2]: https://www.st.com/resource/en/datasheet/stpmic1.pdf Cool series, thanks for cleaning this up! -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D608C433EF for ; Wed, 22 Jun 2022 15:38:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B8FB0245A; Wed, 22 Jun 2022 17:38:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B8FB0245A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655912334; bh=gd+t/oroUC7mPdGiXBHPfPR0Z6CjYYHU9dLMSdStQc0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VsC7oiEbDFE4UtgF8mkRbWVMHpURZWMyeM7Nm8WAODMU9o/miEDMFOljpFdTh6il2 98USO5vNd/6N+rP1FpleUf6ZT6JFRXZnwnWhlfBDhK9ol6ESBXDVr9Sc1jzBUR1XFe nBj+8xdNlzM16vqKYNwUT3t3UAtB6GNpqYWqSSCk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CA918F806F5; Wed, 22 Jun 2022 17:24:01 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4A06BF800E3; Tue, 21 Jun 2022 11:26:01 +0200 (CEST) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0F0FAF800CB for ; Tue, 21 Jun 2022 11:25:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0F0FAF800CB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U4TmMXAV" Received: by mail-ej1-x62d.google.com with SMTP id o7so26183948eja.1 for ; Tue, 21 Jun 2022 02:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NOMsJgOH3MiCNjts6Vy2cOyGVGYl5lD+qutJwwCIfsM=; b=U4TmMXAVNZeGSibLS1ghJJrIiOQVgWj4Qhzr2zXpZ+UjaA8vQDXSqrB0mhffAZ6Y9d XaJxAG/q3qhi8lBbjSlIe4BCARpAkrbeLvmp7yJ8wuR7IahJDrPRtLyghlHUZlUs4nWB FZTWmbA6jN6Dl+1dTCiUI5xSy7dHbNcZ9mHyH7xWZpPiLD4CjNeKT3bkajbgNmUNGssT 58FkgHEVrYlyPbFS9MvU+nFY1iGFJ3jlS3X3KFvPTYe8GBn4g2yDEArJsar8PRNVwU3S TIAQj0k8aL5a3We6gBozjvqbKtUmm2XGgOixTPoPN+2bY4+KThPsVwTq4sbr78gBo2r6 edBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NOMsJgOH3MiCNjts6Vy2cOyGVGYl5lD+qutJwwCIfsM=; b=jww/jqxeGC7xEcgBN2LJsgp/GY3MkwOzAkjm0wWK2EYT+hhhDpWgwRgbKEEwzS9f3b sqggO3C+98InsX5XN6kmkSPguyBbNEDzogiONuxwkvNCn5+pzom0h9F7iHIB0Ez1hdXe 3oh98UEvZ1MvTW7es/sdvHftIW+PKpLE5owt6m5SnrKi425O/rOGFbJLuWHgieu50bkx ZHuEd7JnfG2v5VSM4+8MkMfEFJGLk3ZNW69y27hyQ3XqCTQ3rB1YRVeVo244JMRolsmb Z5Y4Q8IVEPYJpuIcVu2BZHmTmahkx24ekJB7nvua3Y4nVEZFKCDMffqsXS4TuAq+bXnR BTig== X-Gm-Message-State: AJIora+KlEy3OueWbWGi3BifVrkBK/R+QEHgveuTZKWohYPzforNJWkH IYXCRfsQrRw0eZXcN4nwc0LdpVgoM9hAmw5SW4U= X-Google-Smtp-Source: AGRyM1se8Q5QQtyQhqZ276ze+sQZWIHL5X2Uisw4LahZgr/oEQb+koeaLdBeR+uqRMsLqk/klYDHMQOlZMtTnGjBf6c= X-Received: by 2002:a17:907:72c7:b0:722:e5af:f666 with SMTP id du7-20020a17090772c700b00722e5aff666mr1241803ejc.44.1655803552679; Tue, 21 Jun 2022 02:25:52 -0700 (PDT) MIME-Version: 1.0 References: <20220620200644.1961936-1-aidanmacdonald.0x0@gmail.com> In-Reply-To: <20220620200644.1961936-1-aidanmacdonald.0x0@gmail.com> From: Andy Shevchenko Date: Tue, 21 Jun 2022 11:25:16 +0200 Message-ID: Subject: Re: [PATCH 00/49] regmap-irq cleanups and refactoring To: Aidan MacDonald Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Wed, 22 Jun 2022 17:23:18 +0200 Cc: ALSA Development Mailing List , Banajit Goswami , "Rafael J. Wysocki" , Linus Walleij , Bjorn Andersson , Srinivas Kandagatla , MyungJoo Ham , Lee Jones , Samuel Holland , Marc Zyngier , Bartosz Golaszewski , Manivannan Sadhasivam , Krzysztof Kozlowski , Jernej Skrabec , Chanwoo Choi , Chen-Yu Tsai , Andy Gross , orsonzhai@gmail.com, linux-sunxi@lists.linux.dev, Bartlomiej Zolnierkiewicz , linux-arm-msm , tharvey@gateworks.com, linux-actions@lists.infradead.org, "open list:GPIO SUBSYSTEM" , Mark Brown , Takashi Iwai , Thomas Gleixner , Cristian Ciocaltea , linux-arm Mailing List , rjones@gateworks.com, Greg Kroah-Hartman , Liam Girdwood , Linux Kernel Mailing List , Michael Walle , zhang.lyra@gmail.com, baolin.wang7@gmail.com, Matti Vaittinen X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, Jun 20, 2022 at 10:07 PM Aidan MacDonald wrote: > > Hi Mark, > > Here's a bunch of cleanups for regmap-irq focused on simplifying the API > and generalizing it a bit. It's broken up into three refactors, focusing > on one area at a time. > > * Patches 01 and 02 are straightforward bugfixes, independent of the > rest of the series. Neither of the bugs are triggered by in-tree > drivers but they might be worth picking up early anyhow. > > * Patches 03-13 clean up everything related to configuring IRQ types. > > * Patches 14-45 deal with mask/unmask registers. First, make unmask > registers behave more intuitively and usefully, and get rid of the > mask_invert flag in favor of describing inverted mask registers as > unmask registers. Second, make the mask_writeonly flag more useful > and enable it for two chips where it makes sense. > > * Patches 46-49 refactor sub_irq_reg() as a get_irq_reg() callback, > and use that to eliminate the not_fixed_stride flag. > > The approach I used when refactoring is pretty simple: (1) introduce new > functionality in regmap-irq, (2) convert the drivers, and (3) remove any > old code. Nothing should break in the middle. > > The patches can be re-ordered to some extent if that's preferable, but > it's best to add get_irq_reg() last to avoid having to think about how > it interacts with features that'll be removed anyway. > > I can't test most of the devices affected by this series so a lot of the > code is only build tested. I've tested on real hardware with my AXP192 > patchset[1], although it only provides limited code coverage. > > qcom-pm8008 in particular deserves careful testing - it used all of the > features touched by the refactors and required the most changes. Other > drivers only required trivial changes but there are three of them worth > mentioning: wcd943x, wcd9335, and wcd938x. They have suspicious looking > IRQ type definitions and I'm pretty sure aren't working properly, but > I can't fix them myself. The refactor shouldn't affect their behavior > so how / when / if they get fixed shouldn't be much of an issue. > > Oh, and I added the 'mask_writeonly' flag and volatile ranges to the > stpmic1 driver based on its datasheet[2] as a small optimization. It's > probably fine but testing would be a good idea. > > [1]: https://lore.kernel.org/linux-iio/20220618214009.2178567-1-aidanmacdonald.0x0@gmailcom/ > [2]: https://www.st.com/resource/en/datasheet/stpmic1.pdf Cool series, thanks for cleaning this up! -- With Best Regards, Andy Shevchenko