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 B76E8C433FE for ; Fri, 28 Jan 2022 10:05:43 +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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VtXpzYsGrcNoAF6bn5vOQIqtme/0xdIY3gQhOWw9ftg=; b=wf1VG3qJMAtmeH 00ie8VPcwOA1TnMgIbczc5amDyJierxvmt5GVImJ5G3cyRRoTdMEKwzKyRTNRwcgocxh1DshEcJh7 igrsTSFnk8iJdhkhj4IFA3BbhmdYkFOUOaNoqF7RLzPYsffQitfLiHn2L1ICZAmeUIj/RhbeD9aPf Pk1v5IU+wywzLcXPcqwMOXTZP/6BeOgV3leSrFlf+xjIHJnPEs/ybgDQc7KowZu9YQFcJ9E4pWXf6 UBe0tAjO/DjqzfJ2ruY8hP49TJ4BVGZwWIUIjWWtL6K6eP/aco6RW1COYLGJJLyROPnJC1ldB3Ax+ K2Yd14vB/BQwk+5itnTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDO6L-001MlK-8s; Fri, 28 Jan 2022 10:03:30 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDO64-001MhC-W7 for linux-arm-kernel@lists.infradead.org; Fri, 28 Jan 2022 10:03:15 +0000 Received: by mail-wm1-x335.google.com with SMTP id d138-20020a1c1d90000000b0034e043aaac7so5190653wmd.5 for ; Fri, 28 Jan 2022 02:03:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=vQHl1kKziPP//RPPVFscaIeYrQPiD/BKe7PC4j8ax6c=; b=Fzv1T+rGFotkDidQaBLfjgeshzec1rdrJugreJ4E4ER511twVIjRsOWbmAmgAJhSjH soAr9SxHMN2Xd4icay0VOiQTdwpi3tz3SKBN/fxILgf7SD50gxPSUZraeQSsfgeQBO9V DcZ3rReVzhtCSf7rJ7QT7dWsvh8/pFCQroSXhYUEzn04XvlVonYA4PD+9GHrmRcD7krF ERhZuKgCrhUFpyQ6g7pNA5XYtNK6hYzhqRzujjb0YtEL9lqv9De3qaGgo2ya/1uWGHR2 Zx+3EkM+VvtQ+Elu29Bzbqgp+vR1468RQhMEwCCIdI1c1c1JhN8qxFW2kYDS4nFmRwxp CE2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=vQHl1kKziPP//RPPVFscaIeYrQPiD/BKe7PC4j8ax6c=; b=aHLl3pspOYcbnAFobE0iDyC43/nMuWVlAYZo+pEf2UXwPPZuI4zxD5AeMFF2o3qL6g NKtvcRBfk6l1c5eZZqBYQsU1HbkeOW/x8iCdGTlKJbEDrIxkD9/+JeTr892dlVHO1uHW C/1otk4prxc4Ms25o4qs+f9D7QyARLbgiI38taBoGoRS2wWBaUtivmaNh4TvtIi3KHgI HIbHZ8OML9ivf2XnC3maqdMwrNApk/F2Xajhd0ni4rM/I59Ef2NQjSW+hHUh4fLNBjOP ZHZpnHonFpOv49W0CinTLzhj0pz+Fx7WHevF/cpPAnhsZ4xK402DKopYj5qL2w40qRei nt2A== X-Gm-Message-State: AOAM532w2orJerBZJKRT9elqyyPFYQUrzfLD2gxlBU+hXknbrWe05qC5 6RTgxL3TCvDD8ovKR5H00mb+dw== X-Google-Smtp-Source: ABdhPJyVqxevH/KOBMCOHMp1EH4UYJ2z6Ysjjih/WI63AVmR57PKiAmJIQN3MQ9MQW35Da3EV7C4KA== X-Received: by 2002:a7b:c350:: with SMTP id l16mr6542037wmj.146.1643364190814; Fri, 28 Jan 2022 02:03:10 -0800 (PST) Received: from localhost ([2a01:cb1a:7d:5d4:c222:c6fc:1de7:17bc]) by smtp.gmail.com with ESMTPSA id e10sm5407686wrq.53.2022.01.28.02.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 02:03:10 -0800 (PST) From: Mattijs Korpershoek To: Andy Shevchenko Cc: Dmitry Torokhov , Marco Felsch , Rob Herring , Matthias Brugger , Fengping Yu , Yingjoe Chen , Fabien Parent , Kevin Hilman , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v20 2/3] Input: mt6779-keypad - Add MediaTek keypad driver In-Reply-To: References: <20220127111526.3716689-1-mkorpershoek@baylibre.com> <20220127111526.3716689-3-mkorpershoek@baylibre.com> Date: Fri, 28 Jan 2022 11:03:08 +0100 Message-ID: <87v8y4p483.fsf@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220128_020313_136640_0F04BD56 X-CRM114-Status: GOOD ( 22.99 ) 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 Thu, Jan 27, 2022 at 17:20, Andy Shevchenko wrote: > On Thu, Jan 27, 2022 at 12:15:25PM +0100, Mattijs Korpershoek wrote: >> From: "fengping.yu" >> >> This patch adds matrix keypad support for Mediatek SoCs. > > Some comments which may be addressed now or in the follow-up patch(es). > Up to you. Hi Andy, Thank you for your review and your suggestions. > > ... > >> +static const struct regmap_config mt6779_keypad_regmap_cfg = { >> + .reg_bits = 32, >> + .val_bits = 32, > >> + .reg_stride = sizeof(u32), > > I'm wondering if we need this when we have reg_bits = 32 already. Per my understanding, .reg_stride is mainly used to check for invalid register addresses in regmap_{read,write}(): if (!IS_ALIGNED(reg, map->reg_stride)) return -EINVAL; If .reg_stride is not set, regmap core will default it to 1. It's not computed from reg_bits. So I think we still need it. > >> + .max_register = 36, >> +}; > > ... > >> + regmap_write(keypad->regmap, MTK_KPD_DEBOUNCE, >> + (debounce * 32) & MTK_KPD_DEBOUNCE_MASK); > > I'm wondering if << 5 is more specific to show that the value > is based on 2^5 units. The datasheet I've seen states: "De-bounce time = KP_DEBOUNCE / 32ms" But rewriting it as 1 << 5 seems reasonable as well: regmap_write(keypad->regmap, MTK_KPD_DEBOUNCE, (debounce * (1 << 5)) & MTK_KPD_DEBOUNCE_MASK); I don't have any preference on this one. If I have to send a v21, I will rewrite it using (1 << 5) > > ... > >> + error = devm_add_action_or_reset(&pdev->dev, mt6779_keypad_clk_disable, keypad->clk); > > You have this long line... > >> + error = devm_request_threaded_irq(&pdev->dev, irq, >> + NULL, mt6779_keypad_irq_handler, >> + IRQF_ONESHOT, >> + MTK_KPD_NAME, keypad); > > ...at the same time you may reduce LOCs here... Ack. will join lines to reduce LOCs if I have to send v21. > >> + if (error) { >> + dev_err(&pdev->dev, "Failed to request IRQ#%d:%d\n", >> + irq, error); > > ...and here. Ack. will join lines to reduce LOCs if I have to send v21. > >> + return error; >> + } > > -- > 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