Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3515350imu; Fri, 18 Jan 2019 11:45:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Rdj7Xxj3BpO/sMVS4wLtSIGk6JsWJZfpxvcLPEFibOurgHdKFRr86RXkc5dpQngwFwRZJ X-Received: by 2002:a63:e247:: with SMTP id y7mr18184724pgj.84.1547840737287; Fri, 18 Jan 2019 11:45:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547840737; cv=none; d=google.com; s=arc-20160816; b=eFCxsFBaDrT6+qrVAL4cXzH/kauL9AkU6/l/BGAru+fs7gRWFB+p7X9GMwNXgzWicd tJ1zDxC/pYnjDHV0NRaxSHEbYeUK4Sd61w+ON5NvSOWczHB9plibea18OsgO16utLl9A IONdXXPabszB8uhDS+9N5PVPVdWxNhUR56OVe7qh+NVCpQ3ixYi37YxSWzzqdPNNXw5J UXulValwytLzogbdx0wbyPU8UXB0xeKDgheMs1Y6lc4+xQhn89QZf1xl/H94ym2GaYeG sv9skoKSnyoFne+btzJqystT+Xf+UmZd/j7mYHwvEWsZIcmuqgTsBbaJ+2O0TWnRqn78 ZIuA== 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=Fn/ZaOA4TCft1SNkMg6+ljUMYqlYSPj3PIG9fg7fiSU=; b=tpIc1/0PUtnq8XzU/ymmFsPuV40yLAO/bBfKcrbsG0uTDqeU960gL04cca67K2VcZA t7+BMixsLYpkv8Qifml1i7gi4y2OYPnWszSe6iWKlltuVYc9g0nm+b6fjljKDAJDKiYp e1szbtXr2XUmTcB/kEY7AYPVk2rNyBAYAhm74WO8EWLESK7xATjYdTNbTBDGsISdvmdx L1AzblKOdOrO1/g4UOByijq85AVAvYZT3Xhe0ALp4/nj8ZIzl4Pf+r+5IDQqM5oS4IAq KlySc+J1+eYMTlzZPSb+4yoWi0cohhMBJxjCZTrajnV9R8BXNxwcTV4fy0Rtynt/vUeo +cSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=kLwy1V2e; 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 j5si4969336pgq.82.2019.01.18.11.45.21; Fri, 18 Jan 2019 11:45:37 -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=@cogentembedded-com.20150623.gappssmtp.com header.s=20150623 header.b=kLwy1V2e; 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 S1729377AbfARTn3 (ORCPT + 99 others); Fri, 18 Jan 2019 14:43:29 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:45987 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729218AbfARTn3 (ORCPT ); Fri, 18 Jan 2019 14:43:29 -0500 Received: by mail-lj1-f195.google.com with SMTP id s5-v6so12554510ljd.12 for ; Fri, 18 Jan 2019 11:43:27 -0800 (PST) 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=Fn/ZaOA4TCft1SNkMg6+ljUMYqlYSPj3PIG9fg7fiSU=; b=kLwy1V2ehwDdsIG4T92DCTb2UHcz6vgw11zko6/U5r65PH12y1/9pgleiqeUFd+Rav ZA0cPdMYou5VTnB37xvBfUhQZ3X9JtueMqu6q/LODpUYmPOAS5/5+8VHIvxfXhALuexa /4YiVDHzu6QSOkLzfyr09HjiEvS/dSc4Q2Om3y3OJZNku/klYUDlbUAm45E1xv2qkJ4L ipQjqSyikmfAzqpjfVpG6mErcRnUHQXHGaVr6eRikBM0FXXnjdsgue01vCCElV0yhGly 7vXiNIM3qQqnb2OmZDjLElbcjD3g/gROqlMiOyNL5OeM2/4CpQNMt+cH+0otNR3nNjYt dgyQ== 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=Fn/ZaOA4TCft1SNkMg6+ljUMYqlYSPj3PIG9fg7fiSU=; b=EEhIn65jkAXJ2/zFMucq8u7jmJ18eQoxdTOHB1hyIb/0OqMdPJXJz+I1ECFxd7W7gj VQkwNAtiCUNtG8HVpl93Toyyq0BYsnMSfeVEHBtqdjZ5VQq63/YBs+eydwWYkvGTyQYK JxePkpkNYePYb8mlcwWwSYAvpDPIH4ziNJMt9XRl09vBSHtqQec8S0iVhMApP7PM6Lnw 51YWuw3xJvGfjxOhcqwODEpz/iT5wQZW4dMEwL3QtuHJrQp3PY4dPK5noPEvk5FiJtsO UGpZvw1EKZuOekO1g45dR4bfmLqVTNZutwwv5thaJnFW4qEw13RE2xqK834fVjVaD8We bcxg== X-Gm-Message-State: AJcUukfZaLurlI8G9Mhjlri04AkrJcpl5kYZUhMrWfnBS+bXRYw5DWh2 QV6RyFr2Hh8hfLrvB3QF8FCP/Ug0RCY= X-Received: by 2002:a2e:8951:: with SMTP id b17-v6mr2049717ljk.142.1547840606907; Fri, 18 Jan 2019 11:43:26 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.87.207]) by smtp.gmail.com with ESMTPSA id p89-v6sm893729ljp.60.2019.01.18.11.43.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 11:43:25 -0800 (PST) Subject: Re: [PATCH v6 1/2] spi: Add Renesas R-Car Gen3 RPC-IF SPI 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 Cc: juliensu@mxic.com.tw, Simon Horman , zhengxunli@mxic.com.tw References: <1547790855-22120-1-git-send-email-masonccyang@mxic.com.tw> <1547790855-22120-2-git-send-email-masonccyang@mxic.com.tw> From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: Date: Fri, 18 Jan 2019 22:43:24 +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: <1547790855-22120-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 Hello! On 01/18/2019 08:54 AM, Mason Yang wrote: > Add a driver for Renesas R-Car Gen3 RPC-IF SPI controller. > > Signed-off-by: Mason Yang > Signed-off-by: Sergei Shtylyov [...] > diff --git a/drivers/spi/spi-renesas-rpc.c b/drivers/spi/spi-renesas-rpc.c > new file mode 100644 > index 0000000..692c760 > --- /dev/null > +++ b/drivers/spi/spi-renesas-rpc.c > @@ -0,0 +1,800 @@ [...] > +#define RPC_DRENR 0x001C // R/W > +#define RPC_DRENR_CDB(o) (u32)((((o) & 0x3) << 30)) > +#define RPC_DRENR_OCDB(o) (((o) & 0x3) << 28) > +#define RPC_DRENR_ADB(o) (((o) & 0x3) << 24) > +#define RPC_DRENR_OPDB(o) (((o) & 0x3) << 20) > +#define RPC_DRENR_SPIDB(o) (((o) & 0x3) << 16) Manual v1.00 calls it DRDB, not SPIDB. [...] > +#define RPC_SMENR 0x0030 // R/W > +#define RPC_SMENR_CDB(o) (((o) & 0x2) << 30) > +#define RPC_SMENR_OCDB(o) (((o) & 0x2) << 28) > +#define RPC_SMENR_ADB(o) (((o) & 0x2) << 24) > +#define RPC_SMENR_OPDB(o) (((o) & 0x2) << 20) > +#define RPC_SMENR_SPIDB(o) (((o) & 0x2) << 16) Ugh, s/0x2/0x3/! :-/ [...] > +#define RPC_SMDRENR 0x0064 // R/W > +#define RPC_SMDRENR_HYPE (0x5 << 12) s/0x5/0x7/, and this is a field, not value. [...] > +static int rpc_spi_probe(struct platform_device *pdev) > +{ > + struct spi_controller *ctlr; > + struct resource *res; > + struct rpc_spi *rpc; > + const struct regmap_config *regmap_config; > + struct device_node *rpc_if; > + int ret; > + > + rpc_if = of_find_compatible_node(pdev->dev.of_node, NULL, > + "jedec,spi-nor"); I doubt that this is a correct function to check for the child node's "compatible" prop... [...] > + regmap_config = &rpc_spi_regmap_config; Doesn't look like this variable is needed... > + rpc->regmap = devm_regmap_init_mmio(&pdev->dev, rpc->base, > + regmap_config); > + if (IS_ERR(rpc->regmap)) { > + dev_err(&pdev->dev, "failed to init regmap %ld for rpc-spi\n", How about: dev_err(&pdev->dev, "failed to init regmap for rpc-spi, error %ld\n", [...] > + ret = spi_register_controller(ctlr); > + if (ret) { > + dev_err(&pdev->dev, "spi_register_master failed\n"); You forgot to update the message. :-) [...] MBR, Sergei