Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1841982ybh; Fri, 17 Jul 2020 02:38:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgI20lgL6+Gom4NaVbOYAsU+oXPNMaQAdcdzoC3Zvaj0IM4UEpUMIPNQotrkFRY8bJLxqg X-Received: by 2002:a05:6402:1c96:: with SMTP id cy22mr8231271edb.79.1594978731033; Fri, 17 Jul 2020 02:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594978731; cv=none; d=google.com; s=arc-20160816; b=QphzGApLzSRyHhGOnTK8ju2NWf/48a4B36lQad6qRZYAD1eqEo8Y+wQvyccOOFHtT2 kB4uFkSHb5DYnJheweL3brJNv/wd/AQusXyoewYjYMM29r4V3+72x501xlKNby/1I7xf JPVyK9eI+npDmOvoVJWSDQ3d5PiN8gnryvQzv+yX55tj1VGR0KN4ODpJ6X4gQILFcVtG u0IB3WdQws1Ab3/O1LAVvaMg1WG17xayJNVMYLIS/M9UYAMlXp2056imt8efvRvhDLVS lKlUhS8dedY6BAn/q6wyY7kRTOWnbpIkWFNljwsnSM8M0xSd4Z1KHQNywCG0evM0x6ud fvOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=L84Tbx7w0d/FjjhoBml/6zKrkq6kkL1C9n9lSr0rc/U=; b=DH41VYxwTng/U7RdfGNyIRKEIXiLsBb61LCt0M7tm54x35Q77p9a7twxymBgV1yNXJ nZ8DdOOctpe+uwP+jN19A9FO5rLLQfyhnx233h7lqCR8jowIzAwHIvC+WPukG00kBTyo sXBw2zUhdSUYWjwRcV7oqI2nqOusdv++kJQTW3/IVWOvOWRd4PwGkz8LTsTQXDDtwur2 fBu+8T7YaIooL9OkmFOhm/OKcauebykVngvy8Qoe+QL03gIb7U6JOSqif0Z1VJmOYlYp mZQEYVDxV4VU2+f/mF+tJlNij6/K+QUP97Hx7YHM3QU8rGtrG+nFgZj3tKnlVXzA0Em1 MyyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TVSu3R8v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y16si4746130edv.476.2020.07.17.02.38.28; Fri, 17 Jul 2020 02:38:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TVSu3R8v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726759AbgGQJgD (ORCPT + 99 others); Fri, 17 Jul 2020 05:36:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbgGQJgC (ORCPT ); Fri, 17 Jul 2020 05:36:02 -0400 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F801C061755 for ; Fri, 17 Jul 2020 02:36:02 -0700 (PDT) Received: by mail-il1-x141.google.com with SMTP id t18so6815571ilh.2 for ; Fri, 17 Jul 2020 02:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=L84Tbx7w0d/FjjhoBml/6zKrkq6kkL1C9n9lSr0rc/U=; b=TVSu3R8vblnAn5ZK5sAEJ+9hv/lK9MiA0wmU1CwnleVCQmsnYALB/Vc/ze+H2gGMvq tsqiOZUVPTVdKnoIGUTLjOpeOfhUfL7TLCdBz/X5kEGhK/x8kLRjmUbhB8MwQAvgrD9v KsePMnmSw478OY/u1qtLCvsl1PaPI22ULkpOoE+B1SLvHJkYlQi8PGXJqPCKkFI/C86z BtGzQOWO+uPQ36Ne6FgLsJqymyZy5b7dUNDyJcXke3GZRjMgQ9Zlq4ywjPgQhG7WB3rv wMq5vlwFeACP1DTiCwbTFEEq5z8gOZPUWRVe5UAO6SWXV4MNWIhSJDd8ymhnno9M9Cpb rrdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=L84Tbx7w0d/FjjhoBml/6zKrkq6kkL1C9n9lSr0rc/U=; b=IJIPjBJMomAlKBPqpZUDbU1RUD2GGB+13nHYbd31mWUJP7+DkG9e1tdjtGBRicvdsX rPgG6a8M88VaJRknBWdZ8kaFRPGuxsNUphNEVBvTROOCa7B2/QoHNo4icXgBs//TcaFe +bNK+lWfZGSJqNTLSRmie8SKw9b7nxBYjiH42JqkWl6WSwzxaVGbEnRby+IXkUXs0D17 22oQQNuTBz1BGOAOaq+KQtFlQJgCfE5VJU8MpRQchlqhWBRlM8yELym0lZcevxV9OGzp RdPbhms6nT/V10SSSwF261cUtb9eksljk7zqbw1Ldjbk7BOTz45gXefQeet7RwQW6rOk O9fg== X-Gm-Message-State: AOAM532SMriE7dYCZKyAYJerDqm5ULuxoRjg2JAbgnjWOzdPUXngj9a7 nLGPaip8WDLPZoDRHtei79/lRf9/SwSyau0mnXIpSVU9 X-Received: by 2002:a92:9f96:: with SMTP id z22mr9183788ilk.266.1594978561818; Fri, 17 Jul 2020 02:36:01 -0700 (PDT) MIME-Version: 1.0 References: <1594117856-14343-1-git-send-email-gene.chen.richtek@gmail.com> <1594117856-14343-3-git-send-email-gene.chen.richtek@gmail.com> <8fa489a0-7672-cbbd-ec04-32803ca69084@gmail.com> In-Reply-To: <8fa489a0-7672-cbbd-ec04-32803ca69084@gmail.com> From: Gene Chen Date: Fri, 17 Jul 2020 17:35:50 +0800 Message-ID: Subject: Re: [PATCH 2/4] mfd: mt6360: Remove handle_post_irq callback function To: Matthias Brugger Cc: Lee Jones , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Gene Chen , shufan_lee@richtek.com, cy_huang@richtek.com, benjamin.chao@mediatek.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matthias Brugger =E6=96=BC 2020=E5=B9=B47=E6=9C=88= 10=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=8810:22=E5=AF=AB=E9=81=93=EF= =BC=9A > > > > On 07/07/2020 12:30, Gene Chen wrote: > > From: Gene Chen > > > > Remove handle_post_irq which is used to retrigger irq. > > Set irq level low trigger to keep irq always be handled. > > > > Signed-off-by: Gene Chen > > --- > > drivers/mfd/mt6360-core.c | 25 ++++++++----------------- > > include/linux/mfd/mt6360.h | 6 +++--- > > 2 files changed, 11 insertions(+), 20 deletions(-) > > > > diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c > > index 5dfc13e..2dd5918 100644 > > --- a/drivers/mfd/mt6360-core.c > > +++ b/drivers/mfd/mt6360-core.c > > @@ -208,24 +208,16 @@ static const struct regmap_irq mt6360_irqs[] =3D = { > > REGMAP_IRQ_REG_LINE(MT6360_LDO7_PGB_EVT, 8), > > }; > > > > -static int mt6360_pmu_handle_post_irq(void *irq_drv_data) > > -{ > > - struct mt6360_data *data =3D irq_drv_data; > > - > > - return regmap_update_bits(data->regmap, > > - MT6360_PMU_IRQ_SET, MT6360_IRQ_RETRIG, MT6360_IRQ_RETRIG)= ; > > -} > > - > > -static struct regmap_irq_chip mt6360_irq_chip =3D { > > +static const struct regmap_irq_chip mt6360_irq_chip =3D { > > + .name =3D "mt6360_irqs", > > .irqs =3D mt6360_irqs, > > .num_irqs =3D ARRAY_SIZE(mt6360_irqs), > > - .num_regs =3D MT6360_PMU_IRQ_REGNUM, > > - .mask_base =3D MT6360_PMU_CHG_MASK1, > > - .status_base =3D MT6360_PMU_CHG_IRQ1, > > - .ack_base =3D MT6360_PMU_CHG_IRQ1, > > + .num_regs =3D MT6360_IRQ_REGNUM, > > + .mask_base =3D MT6360_REG_PMU_CHGMASK1, > > + .status_base =3D MT6360_REG_PMU_CHGIRQ1, > > + .ack_base =3D MT6360_REG_PMU_CHGIRQ1, > > Non relevant patches for the commit. Please drop this. > ACK > > .init_ack_masked =3D true, > > .use_ack =3D true, > > - .handle_post_irq =3D mt6360_pmu_handle_post_irq, > > }; > > > > static const struct regmap_config mt6360_pmu_regmap_config =3D { > > @@ -339,10 +331,9 @@ static int mt6360_probe(struct i2c_client *client) > > return -ENODEV; > > } > > > > - mt6360_irq_chip.irq_drv_data =3D data; > > ret =3D devm_regmap_add_irq_chip(&client->dev, data->regmap, clie= nt->irq, > > - IRQF_TRIGGER_FALLING, 0, > > - &mt6360_irq_chip, &data->irq_data)= ; > > + IRQF_ONESHOT, 0, &mt6360_irq_chip, > > From what I see IRQF_ONESHOT is set implicitly in regmap_add_irq_chip_fw= node. > Actually I think what you want to add is IRQF_TRIGGER_LOW. > ACK. I will modify argument "irqflags" to 0, because irq trigger type is set by of_irq_get function > > + &data->irq_data); > > if (ret) { > > dev_err(&client->dev, "Failed to add Regmap IRQ Chip\n"); > > return ret; > > diff --git a/include/linux/mfd/mt6360.h b/include/linux/mfd/mt6360.h > > index 76077e4..9fc6718 100644 > > --- a/include/linux/mfd/mt6360.h > > +++ b/include/linux/mfd/mt6360.h > > @@ -179,7 +179,7 @@ struct mt6360_data { > > #define MT6360_PMU_SPARE2 (0xA0) > > #define MT6360_PMU_SPARE3 (0xB0) > > #define MT6360_PMU_SPARE4 (0xC0) > > -#define MT6360_PMU_CHG_IRQ1 (0xD0) > > +#define MT6360_REG_PMU_CHGIRQ1 (0xD0) > > #define MT6360_PMU_CHG_IRQ2 (0xD1) > > #define MT6360_PMU_CHG_IRQ3 (0xD2) > > #define MT6360_PMU_CHG_IRQ4 (0xD3) > > @@ -211,7 +211,7 @@ struct mt6360_data { > > #define MT6360_PMU_BUCK2_STAT (0xED) > > #define MT6360_PMU_LDO_STAT1 (0xEE) > > #define MT6360_PMU_LDO_STAT2 (0xEF) > > -#define MT6360_PMU_CHG_MASK1 (0xF0) > > +#define MT6360_REG_PMU_CHGMASK1 (0xF0) > > #define MT6360_PMU_CHG_MASK2 (0xF1) > > #define MT6360_PMU_CHG_MASK3 (0xF2) > > #define MT6360_PMU_CHG_MASK4 (0xF3) > > @@ -230,7 +230,7 @@ struct mt6360_data { > > #define MT6360_PMU_MAXREG (MT6360_PMU_LDO_MASK2) > > > > /* MT6360_PMU_IRQ_SET */ > > -#define MT6360_PMU_IRQ_REGNUM (MT6360_PMU_LDO_IRQ2 - MT6360_PMU= _CHG_IRQ1 + 1) > > Not relevant for the commit. But why did you use this strange computation= in the > first place? > I wanted to emphasize irq range with start and end address. > > +#define MT6360_IRQ_REGNUM 16 > > #define MT6360_IRQ_RETRIG BIT(2) > > > > #define CHIP_VEN_MASK (0xF0) > >