Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3252780yba; Tue, 16 Apr 2019 07:42:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8NlBwk3nuxkDRErOOURuxNo8AIulWF38A8D+CbH/nlqnrtV/frfLX8ne2/K0zvhgUv3PB X-Received: by 2002:aa7:8c56:: with SMTP id e22mr83877641pfd.155.1555425776911; Tue, 16 Apr 2019 07:42:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555425776; cv=none; d=google.com; s=arc-20160816; b=YYM5wPfu3abBh+vytCLDT6VXC07usufMKFU91+cK2sHuKOBAl9tfCx57Nt0iWSZp+X GclC1wfmGpyRQ805V8nStiUMwH/3uGlvZPMRCvqVo9JbevoZn9+rla+RefsDZtypc0us BlM9jd+4uchjxHXAsWYJ19f8Uwk6rNAy9eNjlP9GL1m1Vs8jIL96n9XSljVVSz20JhEA Uvsz91zJDcXcFxF4XkaP2Dmf5aMNyqrkPbw4axmrNJCtEVg0xd9vrRU1lAQNurVIiAkT tm4hTLF7i5TTpdvg8Q+uGDJqcM24tj57PZFLYe26+Hzfql3EGmY5gwhssq48uLxirazW ooQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=0KHeD9bWy08XmZa1U4uOvQ7JKzo8C8W9LPW0MpfvTCo=; b=jRtj77qSArqvIXEe2deUwQ1kFRt5X2twgB9PyYeLwcQN+LUh9y+gtLyoAsWw8y9Ixq gsIY+rYniRvYVZm6dlErvAinFJ+ddvWsreZfMYpG0SIzJI2MKjrwDL2JT6yh4ZmhQi6y g6rhhcCixrEsGbtvR+iH7Nhg6iGCwxWWDO4Mi07fRSkEETvf7bc1Qub5xTCUepTGhTnx hj3BGsTCFHfgxR9cdBBFzNJcjGixUSbBytN9Uev52AUYsBZXAUI/1yjXqe/TOMueQI0T nHPzdr2PrshfzITOTbTxGA0zj/oxLummQDlwZSEMeV8PxCSOIXvANoCoRCyvCk3yGYLC bgBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=mY6ohycQ; 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=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w71si38958672pgd.470.2019.04.16.07.42.40; Tue, 16 Apr 2019 07:42:56 -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=@synopsys.com header.s=mail header.b=mY6ohycQ; 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=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729433AbfDPOl6 (ORCPT + 99 others); Tue, 16 Apr 2019 10:41:58 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:59484 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725796AbfDPOl6 (ORCPT ); Tue, 16 Apr 2019 10:41:58 -0400 Received: from mailhost.synopsys.com (badc-mailhost1.synopsys.com [10.192.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtprelay.synopsys.com (Postfix) with ESMTPS id F091924E0AF7; Tue, 16 Apr 2019 07:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1555425717; bh=Mj2KYnT4wlRC5r8lnNcWpsLPIcNxiWsbVnWdATMOHA4=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=mY6ohycQhmg9iijkpmPqGLSlLpYEhSM8FGzJiXY6fT2dsCoLXQMnKyz4FbO1sBLn4 +9sScwgReWOw0F6W0grOyuQeTPri/P9FLcefkaqkhsnRkhzzX+rfNRWlb86lkNMfDy Bm29ajAu5EJ9abczZrFi60Rpn3VEZcjvSoQKBLEjOLfw8thHq1xbVgNbWjK/TVWMWI r2goeS/W9hL6EH/GUxXz1o4UrbdeCKyNd4Fwg+bXGdMRnC+YAAuOmrIlt+Xdyz/8vU Lsp/5JEnXdoJQI4KOtV8S+ddsDZI+X3v1G3V0sZWJTjYac2UHwMs93kIIcm04bjv+t UYQf+4MiK5clA== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id B438AA0079; Tue, 16 Apr 2019 14:41:53 +0000 (UTC) Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.94) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 16 Apr 2019 07:41:53 -0700 Received: from DE02WEMBXB.internal.synopsys.com ([fe80::95ce:118a:8321:a099]) by DE02WEHTCB.internal.synopsys.com ([::1]) with mapi id 14.03.0415.000; Tue, 16 Apr 2019 16:41:51 +0200 From: Vitor Soares To: Boris Brezillon , Vitor Soares CC: "linux-iio@vger.kernel.org" , "linux-i3c@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "pmeerw@pmeerw.net" , "lars@metafoo.de" , "knaack.h@gmx.de" , "jic23@kernel.org" , "lorenzo.bianconi83@gmail.com" , "bbrezillon@kernel.org" , "rafael@kernel.org" , "gregkh@linuxfoundation.org" , "broonie@kernel.org" , "joao.pinto@synopsys.com" Subject: RE: [PATCH 1/3] remap: Add I3C bus support Thread-Topic: [PATCH 1/3] remap: Add I3C bus support Thread-Index: AQHU88A1Iwl3j+G7wk6IBdZcVvxAIqY+LqaAgACruZA= Date: Tue, 16 Apr 2019 14:41:50 +0000 Message-ID: <13D59CF9CEBAF94592A12E8AE55501350A615995@DE02WEMBXB.internal.synopsys.com> References: <20190416081551.6f21bc38@collabora.com> In-Reply-To: <20190416081551.6f21bc38@collabora.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-dg-ref: =?us-ascii?Q?PG1ldGE+PGF0IG5tPSJib2R5LnR4dCIgcD0iYzpcdXNlcnNcc29hcmVzXGFw?= =?us-ascii?Q?cGRhdGFccm9hbWluZ1wwOWQ4NDliNi0zMmQzLTRhNDAtODVlZS02Yjg0YmEy?= =?us-ascii?Q?OWUzNWJcbXNnc1xtc2ctYzFhMmVmOTctNjA1NS0xMWU5LTgyM2EtZDQ4MWQ3?= =?us-ascii?Q?ODUxODBmXGFtZS10ZXN0XGMxYTJlZjk4LTYwNTUtMTFlOS04MjNhLWQ0ODFk?= =?us-ascii?Q?Nzg1MTgwZmJvZHkudHh0IiBzej0iNjUwMSIgdD0iMTMxOTk4OTkzMDg4MTA5?= =?us-ascii?Q?ODI0IiBoPSJ1VmM1TUx0WmlSbFN4enpKeHlreUJ2ZHdhR289IiBpZD0iIiBi?= =?us-ascii?Q?bD0iMCIgYm89IjEiIGNpPSJjQUFBQUVSSFUxUlNSVUZOQ2dVQUFCUUpBQUFB?= =?us-ascii?Q?M2JtRll2VFVBWFRvRVkrcjR5NzdkT2dSajZ2akx2c09BQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBSEFBQUFDa0NBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?RUFBUUFCQUFBQVZ6ZGhHZ0FBQUFBQUFBQUFBQUFBQUo0QUFBQm1BR2tBYmdC?=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ascii?Q?ekFHNEFjQUJ6QUY4QWJBQnBBR01BWlFCdUFITUFaUUJmQUhRQVpRQnlBRzBB?= =?us-ascii?Q?WHdCekFIUUFkUUJrQUdVQWJnQjBBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUVBQUFBQUFBQUFBZ0FBQUFBQW5nQUFBSFlBWndCZkFHc0FaUUI1?= =?us-ascii?Q?QUhjQWJ3QnlBR1FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?us-ascii?Q?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFRQUFBQUFB?= =?us-ascii?Q?QUFBQ0FBQUFBQUE9Ii8+PC9tZXRhPg=3D=3D?= x-originating-ip: [10.107.25.87] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, From: Boris Brezillon Date: Tue, Apr 16, 2019 at 07:15:51 > Typo in the subject: s/remap/regmap/ >=20 > On Mon, 15 Apr 2019 21:19:39 +0200 > Vitor Soares wrote: >=20 > > Add basic support for I3C bus. > > This is a simple implementation that only give support > > for Read and Write commands. > >=20 > > Signed-off-by: Vitor Soares > > --- > > drivers/base/regmap/Kconfig | 6 +++- > > drivers/base/regmap/Makefile | 1 + > > drivers/base/regmap/regmap-i3c.c | 62 ++++++++++++++++++++++++++++++++= ++++++++ > > include/linux/regmap.h | 20 +++++++++++++ > > 4 files changed, 88 insertions(+), 1 deletion(-) > > create mode 100644 drivers/base/regmap/regmap-i3c.c > >=20 > > diff --git a/drivers/base/regmap/Kconfig b/drivers/base/regmap/Kconfig > > index 6ad5ef4..c8bbf53 100644 > > --- a/drivers/base/regmap/Kconfig > > +++ b/drivers/base/regmap/Kconfig > > @@ -4,7 +4,7 @@ > > # subsystems should select the appropriate symbols. > > =20 > > config REGMAP > > - default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 ||= REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ) > > + default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 ||= REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_I3C) > > select IRQ_DOMAIN if REGMAP_IRQ > > bool > > =20 > > @@ -49,3 +49,7 @@ config REGMAP_SOUNDWIRE > > config REGMAP_SCCB > > tristate > > depends on I2C > > + > > +config REGMAP_I3C > > + tristate > > + depends on I3C > > diff --git a/drivers/base/regmap/Makefile b/drivers/base/regmap/Makefil= e > > index f5b4e88..ff6c7d8 100644 > > --- a/drivers/base/regmap/Makefile > > +++ b/drivers/base/regmap/Makefile > > @@ -16,3 +16,4 @@ obj-$(CONFIG_REGMAP_IRQ) +=3D regmap-irq.o > > obj-$(CONFIG_REGMAP_W1) +=3D regmap-w1.o > > obj-$(CONFIG_REGMAP_SOUNDWIRE) +=3D regmap-sdw.o > > obj-$(CONFIG_REGMAP_SCCB) +=3D regmap-sccb.o > > +obj-$(CONFIG_REGMAP_I3C) +=3D regmap-i3c.o > > diff --git a/drivers/base/regmap/regmap-i3c.c b/drivers/base/regmap/reg= map-i3c.c > > new file mode 100644 > > index 0000000..565997b > > --- /dev/null > > +++ b/drivers/base/regmap/regmap-i3c.c > > @@ -0,0 +1,62 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * Copyright (c) 2018 Synopsys, Inc. and/or its affiliates. > > + * > > + * Author: Vitor Soares > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > + > > +static int regmap_i3c_write(void *context, const void *data, size_t co= unt) > > +{ > > + struct device *dev =3D context; > > + struct i3c_device *i3c =3D dev_to_i3cdev(dev); > > + struct i3c_priv_xfer xfers[] =3D { > > + { > > + .rnw =3D false, > > + .len =3D count, > > + .data.out =3D data, > > + }, > > + }; > > + > > + return i3c_device_do_priv_xfers(i3c, xfers, 1); > > +} > > + > > +static int regmap_i3c_read(void *context, > > + const void *reg, size_t reg_size, > > + void *val, size_t val_size) > > +{ > > + struct device *dev =3D context; > > + struct i3c_device *i3c =3D dev_to_i3cdev(dev); > > + struct i3c_priv_xfer xfers[2]; > > + > > + xfers[0].rnw =3D false; > > + xfers[0].len =3D reg_size; > > + xfers[0].data.out =3D reg; > > + > > + xfers[1].rnw =3D true; > > + xfers[1].len =3D val_size; > > + xfers[1].data.in =3D val; > > + > > + return i3c_device_do_priv_xfers(i3c, xfers, 2); > > +} > > + > > +static struct regmap_bus regmap_i3c =3D { > > + .write =3D regmap_i3c_write, > > + .read =3D regmap_i3c_read, > > +}; > > + > > +struct regmap *__devm_regmap_init_i3c(struct i3c_device *i3c, > > + const struct regmap_config *config, > > + struct lock_class_key *lock_key, > > + const char *lock_name) > > +{ > > + return __devm_regmap_init(&i3c->dev, ®map_i3c, &i3c->dev, config, > > + lock_key, lock_name); > > +} > > +EXPORT_SYMBOL_GPL(__devm_regmap_init_i3c); > > + > > +MODULE_LICENSE("GPL"); > > diff --git a/include/linux/regmap.h b/include/linux/regmap.h > > index daeec7d..f65984d 100644 > > --- a/include/linux/regmap.h > > +++ b/include/linux/regmap.h > > @@ -25,6 +25,7 @@ struct module; > > struct clk; > > struct device; > > struct i2c_client; > > +struct i3c_device; > > struct irq_domain; > > struct slim_device; > > struct spi_device; > > @@ -624,6 +625,10 @@ struct regmap *__devm_regmap_init_slimbus(struct s= lim_device *slimbus, > > const struct regmap_config *config, > > struct lock_class_key *lock_key, > > const char *lock_name); > > +struct regmap *__devm_regmap_init_i3c(struct i3c_device *i3c, > > + const struct regmap_config *config, > > + struct lock_class_key *lock_key, > > + const char *lock_name); > > /* > > * Wrapper for regmap_init macros to include a unique lockdep key and = name > > * for each call. No-op if CONFIG_LOCKDEP is not set. > > @@ -982,6 +987,21 @@ bool regmap_ac97_default_volatile(struct device *d= ev, unsigned int reg); > > #define devm_regmap_init_slimbus(slimbus, config) \ > > __regmap_lockdep_wrapper(__devm_regmap_init_slimbus, #config, \ > > slimbus, config) > > + > > +/** > > + * devm_regmap_init_i3c() - Initialise managed register map >=20 > Maybe we should have a more specific name here, as some might want to > access registers using HDR modes (devm_regmap_init_i3c_sdr()?) That make sense if the device with HDR capability is able to do=20 everything in HDR mode and I'm not sure about that. I would like to wait for a couple of commercial devices before that=20 change. >=20 >=20 > > + * > > + * @i3c: Device that will be interacted with > > + * @config: Configuration for register map > > + * > > + * The return value will be an ERR_PTR() on error or a valid pointer > > + * to a struct regmap. The regmap will be automatically freed by the > > + * device management code. > > + */ > > +#define devm_regmap_init_i3c(i3c, config) \ > > + __regmap_lockdep_wrapper(__devm_regmap_init_i3c, #config, \ > > + i3c, config) > > + > > int regmap_mmio_attach_clk(struct regmap *map, struct clk *clk); > > void regmap_mmio_detach_clk(struct regmap *map); > > void regmap_exit(struct regmap *map); Thanks for your feedback. Best regards, Vitor Soares