Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp436385ima; Fri, 26 Oct 2018 00:18:38 -0700 (PDT) X-Google-Smtp-Source: AJdET5fgRDch6+ibg7O6/NkDDpk/KqcjMxm9Dk2cU2yc4JjVP4rpoLQ3G4ym0SXSu3advcq3rnYK X-Received: by 2002:a63:8f09:: with SMTP id n9-v6mr2355300pgd.222.1540538318303; Fri, 26 Oct 2018 00:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540538318; cv=none; d=google.com; s=arc-20160816; b=nvNQRgnRtJxTw2UhqbzGlny3fP+dnU6ds5ASNgM3PHz+gpNhL8VZ1dAmyFjVs1jeJG SKxYmrGiBpxcRyXXvgXUcoAEGAlL8vHiiDCcHwCCJM8qIPj17em3uN4MXZT/C8hNQ8TQ sAGrrDzZ8CPaLXpSeqlCz++K8xm9G2NjlBZM7uKxYPVPA2zuva1W7IdkNDvIDGiDRzuP Qu/LiMGZy8hMjipz6Db9sQuw+BTuc+QXZo2sTHP7JZ93j95UjPCtVNP4bUnC/pcKQFR8 qRoUClaNzhoNLB4rvH3zPS19tWkJpXOz9KfR0yn7iANlevRSCMl71yEoBtB1/IBAhI0h L4ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FUJrcpHpUpZEIpEc+xq9EoWGLTV8G0GCGqJDgZz0kjw=; b=IY8Anapyb3t/rkm16qMIQFtZz7y5brpKzzcE3vRb5RVSuDtmUDa5iezuRzCSmX9OKK fMUIPAXEPiaSzdx+U19FspICtr6QyfCgLAYrP1OYcb5fSeRlcMLOsXNW7S4KvnTg/MQr n9tqWGqZTUEnGXMHm7q4EOB6ahUvnanS85tjNyCJz/uh75y2S8qRYhvCejOPjA0EIicJ o8pwlh4rQJT5jV+ihvGCBfA8mmrZkJZ4qg9eCo+TVAipOz/EXj0aQ/KZgud0pGbGZSOB ZA1dw5zsDC3V/FVRb4LlIZaWu6gRtvlPAPkWIxkWQmQV+ri+XGDW5CnuQJnsZsZPMGhj rCOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dG90j/k5"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a21-v6si10016815pff.126.2018.10.26.00.18.22; Fri, 26 Oct 2018 00:18:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dG90j/k5"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbeJZPxk (ORCPT + 99 others); Fri, 26 Oct 2018 11:53:40 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43512 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbeJZPxk (ORCPT ); Fri, 26 Oct 2018 11:53:40 -0400 Received: by mail-wr1-f66.google.com with SMTP id t10-v6so177060wrn.10 for ; Fri, 26 Oct 2018 00:17:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=FUJrcpHpUpZEIpEc+xq9EoWGLTV8G0GCGqJDgZz0kjw=; b=dG90j/k5avtbXiw8QYS5oRaQcbj2JeRl5WS/hDErkdo5rEJsCUp4TC5tFu6v33CZ7j HWXWNTNdxjgb8sq3d5r7t1+hN1sJQlO87JOaz+bTDI0ZglNDSHrMG+9R6hdmcU3W8Gt4 q4dxOKiuslRy9+kXhJBlWReQPkelgglluDzkY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=FUJrcpHpUpZEIpEc+xq9EoWGLTV8G0GCGqJDgZz0kjw=; b=UsSWxhtegkCcbGgt2Lkz2DOjSyQRVVUg5Rrsr1VATH4M8ubwru+06pEKq4eKggtkUZ wC16QYBfYzcqCDOYKlrbzpQPZUvcuzUuc4to7q1VB5pBxYNtGIQ+2kqV5mIjammIvHJn 2fl+P3/YTMQ4swPFl/jGReNld/cmBLT0wB8PO/RC7xbtuyGg3ifO1hS2zJWe3+/VJFT9 ZjU2H1RTDzishUtxrzUU6b3SVgygo12tXsOkQoZBSAyPUu+dxE9hTm003KYI5gmgmQRV wWzkPP1aQbDfqKmrpnD3rY3TITV8+svyKQDdSPQfJmooiAax9Iq+7pPPHFYQBLQXMPIP Gn1g== X-Gm-Message-State: AGRZ1gLzcImMKL/x2ZmIFAQ06ieyWxzQWXlHhp6Gj6xZqOqXfBjk/yoU 3a1UoYXogFCE6n/v+2cjJZi0xg== X-Received: by 2002:adf:eb48:: with SMTP id u8-v6mr4271971wrn.22.1540538268232; Fri, 26 Oct 2018 00:17:48 -0700 (PDT) Received: from dell ([2.31.167.182]) by smtp.gmail.com with ESMTPSA id 76-v6sm5795539wmf.19.2018.10.26.00.17.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Oct 2018 00:17:47 -0700 (PDT) Date: Fri, 26 Oct 2018 08:17:44 +0100 From: Lee Jones To: Benjamin Gaignard Cc: pascal paillet , dmitry.torokhov@gmail.com, Rob Herring , Mark Rutland , Liam Girdwood , Mark Brown , wim@linux-watchdog.org, Guenter Roeck , linux-input@vger.kernel.org, devicetree@vger.kernel.org, Linux Kernel Mailing List , linux-watchdog@vger.kernel.org, eballetbo@gmail.com Subject: Re: [PATCH v4 2/8] mfd: stpmic1: add stpmic1 driver Message-ID: <20181026071744.GH4870@dell> References: <1539853324-29051-1-git-send-email-p.paillet@st.com> <1539853324-29051-3-git-send-email-p.paillet@st.com> <20181025112156.GB4870@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Oct 2018, Benjamin Gaignard wrote: > Le jeu. 25 oct. 2018 à 13:21, Lee Jones a écrit : > > > > On Thu, 18 Oct 2018, Pascal PAILLET-LME wrote: > > > > > From: pascal paillet > > > > > > stpmic1 is a pmic from STMicroelectronics. The STPMIC1 integrates 10 > > > regulators , 3 switches, a watchdog and an input for a power on key. > > > > Same comments as for the DT binding patch. > > > > > Signed-off-by: pascal paillet > > > --- > > > changes in v4: > > > * rename PONKEY_PU_ACTIVE to PONKEY_PU_INACTIVE > > > > > > drivers/mfd/Kconfig | 13 ++ > > > drivers/mfd/Makefile | 1 + > > > drivers/mfd/stpmic1.c | 401 ++++++++++++++++++++++++++++++++++++++++++++ > > > include/linux/mfd/stpmic1.h | 212 +++++++++++++++++++++++ > > > 4 files changed, 627 insertions(+) > > > create mode 100644 drivers/mfd/stpmic1.c > > > create mode 100644 include/linux/mfd/stpmic1.h [...] > > > +static const struct regmap_irq stpmic1_irqs[] = { > > > + [IT_PONKEY_F] = { .mask = 0x01 }, > > > + [IT_PONKEY_R] = { .mask = 0x02 }, > > > + [IT_WAKEUP_F] = { .mask = 0x04 }, > > > + [IT_WAKEUP_R] = { .mask = 0x08 }, > > > + [IT_VBUS_OTG_F] = { .mask = 0x10 }, > > > + [IT_VBUS_OTG_R] = { .mask = 0x20 }, > > > + [IT_SWOUT_F] = { .mask = 0x40 }, > > > + [IT_SWOUT_R] = { .mask = 0x80 }, > > > + > > > + [IT_CURLIM_BUCK1] = { .reg_offset = 1, .mask = 0x01 }, > > > + [IT_CURLIM_BUCK2] = { .reg_offset = 1, .mask = 0x02 }, > > > + [IT_CURLIM_BUCK3] = { .reg_offset = 1, .mask = 0x04 }, > > > + [IT_CURLIM_BUCK4] = { .reg_offset = 1, .mask = 0x08 }, > > > + [IT_OCP_OTG] = { .reg_offset = 1, .mask = 0x10 }, > > > + [IT_OCP_SWOUT] = { .reg_offset = 1, .mask = 0x20 }, > > > + [IT_OCP_BOOST] = { .reg_offset = 1, .mask = 0x40 }, > > > + [IT_OVP_BOOST] = { .reg_offset = 1, .mask = 0x80 }, > > > + > > > + [IT_CURLIM_LDO1] = { .reg_offset = 2, .mask = 0x01 }, > > > + [IT_CURLIM_LDO2] = { .reg_offset = 2, .mask = 0x02 }, > > > + [IT_CURLIM_LDO3] = { .reg_offset = 2, .mask = 0x04 }, > > > + [IT_CURLIM_LDO4] = { .reg_offset = 2, .mask = 0x08 }, > > > + [IT_CURLIM_LDO5] = { .reg_offset = 2, .mask = 0x10 }, > > > + [IT_CURLIM_LDO6] = { .reg_offset = 2, .mask = 0x20 }, > > > + [IT_SHORT_SWOTG] = { .reg_offset = 2, .mask = 0x40 }, > > > + [IT_SHORT_SWOUT] = { .reg_offset = 2, .mask = 0x80 }, > > > + > > > + [IT_TWARN_F] = { .reg_offset = 3, .mask = 0x01 }, > > > + [IT_TWARN_R] = { .reg_offset = 3, .mask = 0x02 }, > > > + [IT_VINLOW_F] = { .reg_offset = 3, .mask = 0x04 }, > > > + [IT_VINLOW_R] = { .reg_offset = 3, .mask = 0x08 }, > > > + [IT_SWIN_F] = { .reg_offset = 3, .mask = 0x40 }, > > > + [IT_SWIN_R] = { .reg_offset = 3, .mask = 0x80 }, > > > +}; > > > > There should be a MACRO for doing this. > > > > If there isn't, you should author one and put it in the Regmap header. > I don't understand why you want to put this MACRO in regmap header. REGMAP_IRQ_REG() > Offsets and masks are custom from this hardware block. > How can this become generic enough to be put in regmap ? When replying to only a small section of driver/review like this, would you mind trimming any unrelated quoting (as I have now done), please? -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog