Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1630561ybb; Fri, 29 Mar 2019 08:13:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqysXrpkCbip0hvK3cnGikZe5xx2tp8ZvnRLro/0FU1FXkzgfDOLg+geBmuWOuwPVUQPb+vR X-Received: by 2002:a62:f24e:: with SMTP id y14mr47807068pfl.209.1553872424110; Fri, 29 Mar 2019 08:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553872424; cv=none; d=google.com; s=arc-20160816; b=QztScVPNeQJzPPXHl48BU3+Rtr2SK357AUrMz4ADivG21Y2syiqSF4tfqBcAl392UW nvkMXxYPA7dqGcYCScva4/4g2MjbHKzGGLfcJ3bM9EmWYZ00KJ5I5u4Orq0ZawVDVFH6 mgFSMHLqD92knHzWsR2fThEMQsJrMmYN+dhASSNBkIeESXO9MGNRZQBlMyJkCgEpIxCL oV1tYC4CbWPxGCBKT/evN9AZcWEu9W2cRPd5cDn99Ru+E41V+dYy6NdOjrNv/KZ4GzT/ Om5FW8nJLT3UPl8R2b77/r1TNIoBXPiJk27i2kmspo5KiPMz/JbURr5UE1+qyR3o74K5 6CHw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=mo0AFzPMoQ5Z8MnNCzngpyQdfNUsMqZK0C6acsupEhw=; b=dqryEIeo+ZIOwONP6yWRw8QmnM0sn3JPZVKYDBuUVpcrXJdI2LPsiSn1T1ENq2w5rM p9pTDmLAcua8l868v11fYqPhlqfBT/E6IPSNuC3sOHlPQAgLrdPAVGV24uf/goXrj7t3 DQPELcyEiolCIyXMHFwIw6Q6hfnOpiMSF8M1UK8sRqKCuE9iklvsawvzUoTqOZeXvMI8 XaD4mHU0AjLrC3QL09mvc6cje32BOg9JSBwsjIKF2z35BDfRjpk7TjwzJcz2O12r03Wm pbcEgiNBJ/xY8BaF9mqfQdxczIS/MFbpAtAcUajYM5NaAJ/S/PGUQCuvtj80CqzFC7y5 9EGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=W5y32Q8s; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si2075701pgc.122.2019.03.29.08.13.27; Fri, 29 Mar 2019 08:13:44 -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=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=W5y32Q8s; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729351AbfC2PMs (ORCPT + 99 others); Fri, 29 Mar 2019 11:12:48 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:45768 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728903AbfC2PMs (ORCPT ); Fri, 29 Mar 2019 11:12:48 -0400 Received: by mail-lf1-f66.google.com with SMTP id 5so1672742lft.12 for ; Fri, 29 Mar 2019 08:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mo0AFzPMoQ5Z8MnNCzngpyQdfNUsMqZK0C6acsupEhw=; b=W5y32Q8si1p6YbI84orXK1a+mj6uHtD8xJNwH3FnKpoZLeRihDL6NQEwJxjG5qT3nJ 3tfi4g6v1KHJvZoOh+vN4ES1xKAoMhXkz6zFX1j4ClmP0N41wt15sCUUNTw0W3AIvebZ N0Pk7y7Sp/tWZPNwfv13M70wuYBnK4M0NJHDdcj9KixQ7GEFcZNYs1dfZbh2RrWrbz6M KXNZcS+4HQ0f8S/o7ueASid6fCrN+DloImxjMywprgGQZhvrHn0HesYq1fFBCRb+2vJY hRdVhmF3sT5IQuaSMTYjMI3DK0sy075Bm7c7MUEjuiWQq11LkNZYr3SHOlwltq9mQgBx YViw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=mo0AFzPMoQ5Z8MnNCzngpyQdfNUsMqZK0C6acsupEhw=; b=CxDpjq0/Jrg5rq5eWJ16N8RSkR5nmKvpPglp/Ymih31BiW5ztLSEukCRk2Jazmy4ud eWpt7fc16ry5nUtTBDOHrOJTFdNjLrBeBi74iN+ZuHHLsHzGEBBeFunpWCnX3blPJy1/ 6BIYro4cDXhISRl4JAxhd2aBxihs8B/Gq4aI/T1aVGayeK8TFXRYW6/bSQXUw0rfXl30 ZXg8yW9KxTpBFTH09Fik7TPoHMMG7VTgRR/ylfhc9coKkBS6RCS6m39YP5KozGzoK5sM ad20psjhAYoeDifYVj+vowupcJh8BCu9uggV0BfFxOSonq1Ady1cld4j+wRmaITpNFuM hNIA== X-Gm-Message-State: APjAAAWq9aH2ft3tMzXDkoypf6dZ2hKbc6E5jh1+HppsT9XlvtCxIQs6 uyuaCaH4mqTodWTSMFDfTLq0+g== X-Received: by 2002:ac2:50d8:: with SMTP id h24mr25292600lfm.7.1553872365417; Fri, 29 Mar 2019 08:12:45 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.84.161]) by smtp.gmail.com with ESMTPSA id y25sm391724lja.61.2019.03.29.08.12.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 08:12:44 -0700 (PDT) Subject: Re: [PATCH v9 1/3] mfd: Add Renesas R-Car Gen3 RPC-IF MFD controller driver To: Mason Yang , broonie@kernel.org, marek.vasut@gmail.com, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, bbrezillon@kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven , devicetree@vger.kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, lee.jones@linaro.org Cc: juliensu@mxic.com.tw, Simon Horman , zhengxunli@mxic.com.tw References: <1553847606-18122-1-git-send-email-masonccyang@mxic.com.tw> <1553847606-18122-2-git-send-email-masonccyang@mxic.com.tw> From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: <5cf42c96-183c-1edd-8397-1de6e3033f33@cogentembedded.com> Date: Fri, 29 Mar 2019 18:12:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1553847606-18122-2-git-send-email-masonccyang@mxic.com.tw> Content-Type: text/plain; charset=utf-8 Content-Language: en-MW Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/29/2019 11:20 AM, Mason Yang wrote: > Add a driver for Renesas R-Car Gen3 RPC-IF MFD controller. > > Signed-off-by: Mason Yang [...] > diff --git a/drivers/mfd/renesas-rpc.c b/drivers/mfd/renesas-rpc.c > new file mode 100644 > index 0000000..c92bb74 > --- /dev/null > +++ b/drivers/mfd/renesas-rpc.c > @@ -0,0 +1,140 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// > +// Copyright (C) 2018 ~ 2019 Renesas Solutions Corp. > +// Copyright (C) 2019 Macronix International Co., Ltd. > +// > +// R-Car Gen3 RPC-IF MFD driver > +// > +// Author: > +// Mason Yang > +// > + > +#include > +#include > + > +static const struct mfd_cell rpc_hf_ctlr = { > + .name = "rpc-hf", > + .of_compatible = "renesas,rcar-rpc-hf", > +}; > + > +static const struct mfd_cell rpc_spi_ctlr = { > + .name = "rpc-spi", > + .of_compatible = "renesas,rcar-rpc-spi", > +}; > + > +static const struct regmap_range rpc_mfd_volatile_ranges[] = { > + regmap_reg_range(RPC_SMRDR0, RPC_SMRDR0), regmap_reg_range((RPC_SMRDR0, RPC_SMRDR1), like Marek noted? > + regmap_reg_range(RPC_SMWDR0, RPC_SMWDR0), regmap_reg_range((RPC_SMWDR0, RPC_SMWDR1)? > +static int rpc_mfd_probe(struct platform_device *pdev) > +{ > + struct device_node *ctlr; > + const struct mfd_cell *cell; > + struct resource *res; > + struct rpc_mfd *rpc; > + int ret; > + > + ctlr = of_get_next_child(pdev->dev.of_node, NULL); The child should be a CFI or JEDEC flash device, no virtual devices, please. [...] > + rpc->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); > + if (IS_ERR(rpc->rstc)) > + return PTR_ERR(rpc->rstc); > + > + platform_set_drvdata(pdev, rpc); > + > + ret = devm_mfd_add_devices(&pdev->dev, -1, cell, 1, NULL, 0, NULL); > + > + return ret; return devm_mfd_add_devices(&pdev->dev, -1, cell, 1, NULL, 0, NULL); > +} > + > +static int rpc_mfd_remove(struct platform_device *pdev) > +{ > + mfd_remove_devices(&pdev->dev); Why, if you used devm_mfd_add_devices() in the probe method? > + return 0; > +} [...] > diff --git a/include/linux/mfd/renesas-rpc.h b/include/linux/mfd/renesas-rpc.h > new file mode 100644 > index 0000000..209e64f1 > --- /dev/null > +++ b/include/linux/mfd/renesas-rpc.h > @@ -0,0 +1,154 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// > +// Copyright (C) 2018 ~ 2019 Renesas Solutions Corp. > +// Copyright (C) 2019 Macronix International Co., Ltd. > +// > +// R-Car Gen3 RPC-IF MFD driver > +// > +// Author: > +// Mason Yang > +// > + > +#ifndef __MFD_RENESAS_RPC_H > +#define __MFD_RENESAS_RPC_H > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include Is any of these #include's used by the header itself? I don't think so... > + > +#define RPC_CMNCR 0x0000 // R/W Not sure we'd need the registers described in the public header after we place the common RPC-IF code into the MFD driver. We'll see though... [...] MBR, Sergei