Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp322371ybl; Tue, 10 Dec 2019 23:52:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzG+IUiOCpPbuaqH7+skLy1TUDD4Jta1ulp/9lyalhw+J658YtXAXGHoYjxUu7OycX27WR9 X-Received: by 2002:aca:4fcd:: with SMTP id d196mr1779670oib.89.1576050755330; Tue, 10 Dec 2019 23:52:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576050755; cv=none; d=google.com; s=arc-20160816; b=UzG9KvYw33vVIH7q9TdS9FrvwvMAvnmRCiz+auo0gTz2PWTx1VFqcKTaTQ59YjA4RP SKxHNfvHfymDj9aKU1skz0GSZrv/leyCzofJIUCRiKpWbCOxrwInH/xDQzSPc4Q1iLIH xy3XeB2EqIl3V5ghVxqeUDS6dS+o1Ru8YiAXoXlLEgpPMjQwJyft/KkmnEUE4EySd3JK jgEW6vvyqGVT9rtXrNER1yMBEAAzSrmfyFkcqu1EYyfJ0Ac89cXgB2ScNHNvzFV5Ia12 6x/9IaaAU3awFXg4xJPdJ202lf/7/qlhYp4aWu28z+g1QnWyd6l4m+lIewceJXmHt7qG //ng== 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=B4jibqDc1qVy/j2PdbJbaqTCeLaTTJvVeLinEnfDL2M=; b=SVQAPpd8eLbBJ2OFz9FOi91XfSajmucZgKuC0HaOZMWMmReL/UuEN2Hbjq8vyN628N 55eexI4znl32GraaR3sg+6YLxN9pcnvp+TV8BgdQpp29glLLCHv/+sI1Z378Zd5vk7IB sybn7VInhbl0alc3LYFl+nQEnRA0kTZcPoq94BggjrAHCz19acKBB0FKxc98PLbc5vl5 /tdd9G2wRPBmSKGgilD/sGeUijPl3stSBDMKgucglfCTTwY0ni94+Ru3AHzwUKaR2WL6 BIrdJua+DTU5Pdphtm4cWHAUR+s9Ndg8tzzuV6Fww6d0XOmCgNxe0FJ3bsVAEOBi/qs/ pTtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fVzD4IBH; 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 l26si614868oti.152.2019.12.10.23.52.22; Tue, 10 Dec 2019 23:52:35 -0800 (PST) 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=fVzD4IBH; 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 S1728169AbfLKHu3 (ORCPT + 99 others); Wed, 11 Dec 2019 02:50:29 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37602 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbfLKHu3 (ORCPT ); Wed, 11 Dec 2019 02:50:29 -0500 Received: by mail-wm1-f65.google.com with SMTP id f129so5881870wmf.2 for ; Tue, 10 Dec 2019 23:50:27 -0800 (PST) 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=B4jibqDc1qVy/j2PdbJbaqTCeLaTTJvVeLinEnfDL2M=; b=fVzD4IBHnhzl29HjXbGL2UON0m1YkEYEHwu2CQ02YorLWFV+d7/8A0lRI7nlHqSHQT ySaVv7nSwtLKE6Wa5jOP31xgZgr5i/oiGFJ3/x1jSVie2NEA7kgTzr/7ePXjI5LuB25J MwHN2i9mZYBLMtEQqErzJVvW68nsIoUGmPlI4YTKJ9KAZCViHRwX2eDmS4JV1dlVFFUT f7IPlr4mf0CVubumPvqB/KuGEqwsJCWyNoqelHJ0x7FeycTn7joe00y/BKNZkVWQFpFD 87kJkXBRvi4aqYKtn70CUyPMBhxiRuS4zBZvAhnyPFXhemNJkIahB4L1chQZXWBxLr5Y suOw== 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=B4jibqDc1qVy/j2PdbJbaqTCeLaTTJvVeLinEnfDL2M=; b=KzuR+y86ActAmstQ//sY2Bd+vq7BC1wZvHPa9AUAZp9N0pjawdkUvdZ4l+fIPk4yKE 3wvnstMLoiwd8GOMV8t2lVt4S5AVcjsCFTRjAGyPh34rDyf/LpKzW16jbPH84VUi7nsr KH74RXYp19p1CkP47rwoXk/YTBFfDV6lcKMT0J7+md+7aE/aoGduPR9kkIAkg9NvjepN dPrEgLOeO14+amklVHdPOfbdFM5zHs/OSWgHrAAt7GLZKRV6+lXlJmzBpFM8ToXI4gry dyKVM3i9MLYh1p4TnwBE6i6ZxrR9QOMkDHotaoZknzZCDroQkwwUHcsR74vzvqymGYJ8 KQPg== X-Gm-Message-State: APjAAAVuMUEfMUfdtAfL2YMqoVcJaCe04cpdRjnCsRb4ciJg1sB2MVml 1+8nG+jSiTTARRLO9rhzneBOpA== X-Received: by 2002:a1c:f31a:: with SMTP id q26mr1915933wmq.142.1576050627087; Tue, 10 Dec 2019 23:50:27 -0800 (PST) Received: from dell ([2.27.35.147]) by smtp.gmail.com with ESMTPSA id i5sm1271653wml.31.2019.12.10.23.50.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 23:50:26 -0800 (PST) Date: Wed, 11 Dec 2019 07:50:21 +0000 From: Lee Jones To: Andreas Kemnade Cc: robh+dt@kernel.org, mark.rutland@arm.com, a.zummo@towertech.it, alexandre.belloni@bootlin.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, stefan@agner.ch, b.galvani@gmail.com, phh@phh.me, letux-kernel@openphoenux.org Subject: Re: [PATCH v3 3/6] mfd: rn5t618: add irq support Message-ID: <20191211075021.GW3468@dell> References: <20191129212045.18325-1-andreas@kemnade.info> <20191129212045.18325-4-andreas@kemnade.info> <20191210093225.GT3468@dell> <20191210175900.64df7de8@kemnade.info> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191210175900.64df7de8@kemnade.info> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Dec 2019, Andreas Kemnade wrote: > On Tue, 10 Dec 2019 09:32:25 +0000 > Lee Jones wrote: > > > On Fri, 29 Nov 2019, Andreas Kemnade wrote: > > > > > This adds support for irq handling in the rc5t619 which is required > > > > Please capitalise abbreviations and device names (as they do in the > > datasheet). > > > for IRQ vs. irq: I see both things in commit messages. Is there any rule about > that? No, it's preference. Mine is to follow the conventions set out by standard English grammar. Capital letters to start sentences, proper nouns and abbreviations, etc. > > > for properly implementing subdevices like rtc. > > > > "RTC" > > > > > For now only definitions for the variant rc5t619 are included. > > > > > > Signed-off-by: Andreas Kemnade > > > --- > > > Changes in v3: > > > alignment cleanup > > > > > > Changes in v2: > > > - no dead code, did some more testing and thinking for that > > > - remove extra empty lines > > > > > > drivers/mfd/Kconfig | 1 + > > > drivers/mfd/Makefile | 2 +- > > > drivers/mfd/rn5t618-core.c | 34 ++++++++++++++- > > > drivers/mfd/rn5t618-irq.c | 85 +++++++++++++++++++++++++++++++++++++ > > > include/linux/mfd/rn5t618.h | 16 +++++++ > > > 5 files changed, 136 insertions(+), 2 deletions(-) > > > create mode 100644 drivers/mfd/rn5t618-irq.c > > > > > > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > > > index ae24d3ea68ea..522e068d0082 100644 > > > --- a/drivers/mfd/Kconfig > > > +++ b/drivers/mfd/Kconfig > > > @@ -1057,6 +1057,7 @@ config MFD_RN5T618 > > > depends on OF > > > select MFD_CORE > > > select REGMAP_I2C > > > + select REGMAP_IRQ > > > help > > > Say yes here to add support for the Ricoh RN5T567, > > > RN5T618, RC5T619 PMIC. > > > diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile > > > index 110ea700231b..2906d5db67d0 100644 > > > --- a/drivers/mfd/Makefile > > > +++ b/drivers/mfd/Makefile > > > @@ -217,7 +217,7 @@ obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o > > > obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o > > > obj-$(CONFIG_MFD_RK808) += rk808.o > > > > > > -rn5t618-objs := rn5t618-core.o > > > +rn5t618-objs := rn5t618-core.o rn5t618-irq.o > > > obj-$(CONFIG_MFD_RN5T618) += rn5t618.o > > > obj-$(CONFIG_MFD_SEC_CORE) += sec-core.o sec-irq.o > > > obj-$(CONFIG_MFD_SYSCON) += syscon.o > > > diff --git a/drivers/mfd/rn5t618-core.c b/drivers/mfd/rn5t618-core.c > > > index da5cd9c92a59..1e2326217681 100644 > > > --- a/drivers/mfd/rn5t618-core.c > > > +++ b/drivers/mfd/rn5t618-core.c > > > @@ -8,6 +8,7 @@ > > > > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -105,7 +106,8 @@ static int rn5t618_i2c_probe(struct i2c_client *i2c, > > > > > > i2c_set_clientdata(i2c, priv); > > > priv->variant = (long)of_id->data; > > > - > > > + priv->chip_irq = i2c->irq; > > > + priv->dev = &i2c->dev; > > > > '\n' > > > > > priv->regmap = devm_regmap_init_i2c(i2c, &rn5t618_regmap_config); > > > if (IS_ERR(priv->regmap)) { > > > ret = PTR_ERR(priv->regmap); > > > @@ -137,6 +139,11 @@ static int rn5t618_i2c_probe(struct i2c_client *i2c, > > > return ret; > > > } > > > > > > + if (priv->chip_irq > 0) { > > > + if (rn5t618_irq_init(priv)) > > > + priv->chip_irq = 0; > > > + } > > > + > > > return 0; > > > } > > > > > > @@ -154,15 +161,40 @@ static int rn5t618_i2c_remove(struct i2c_client *i2c) > > > return 0; > > > } > > > > > > +static int __maybe_unused rn5t618_i2c_suspend(struct device *dev) > > > +{ > > > + struct rn5t618 *priv = dev_get_drvdata(dev); > > > + > > > + if (priv->chip_irq) > > > + disable_irq(priv->chip_irq); > > > + > > > + return 0; > > > +} > > > + > > > +static int __maybe_unused rn5t618_i2c_resume(struct device *dev) > > > +{ > > > + struct rn5t618 *priv = dev_get_drvdata(dev); > > > + > > > + if (priv->chip_irq) > > > + enable_irq(priv->chip_irq); > > > + > > > + return 0; > > > +} > > > + > > > static const struct i2c_device_id rn5t618_i2c_id[] = { > > > { } > > > }; > > > MODULE_DEVICE_TABLE(i2c, rn5t618_i2c_id); > > > > Not this patch I know, but it's strange to see this empty. > > Yes, should be cleaned up. For now the device tree stuff seems to kick in. I think this can be removed completely. Just make sure you use .probe2 and it should be automatic. [...] > > > + switch (rn5t618->variant) { > > > + case RC5T619: > > > + irq_chip = &rc5t619_irq_chip; > > > + break; > > > + > > > + /* TODO: check irq definitions for other variants */ > > > > No need for this. It's implied. > > > > OOI, when support for more variants be added? > > > I have done research about the RN5T618. It has just the RTC IRQ missing, I could just > add the table for it to prepare the path for others. I cannot test it but > since there are no users yet, it does not harm that it is not well-tested. If there are no users and it can't be tested, it should be left out. We don't want potentially broken, untested code with no users in the kernel. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog