Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1900158ybt; Sun, 28 Jun 2020 01:30:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuewEU7SD/dmv0K36qNYoL2hOp2ecX7mF8WNdn/Vwk6zqMnQkZGsRBnTNLnK3fYH9o+EH7 X-Received: by 2002:a17:906:2c18:: with SMTP id e24mr9914247ejh.335.1593333038961; Sun, 28 Jun 2020 01:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593333038; cv=none; d=google.com; s=arc-20160816; b=gLB1PF8O27hubDOV5JQmszH3DAkH+oxXBjhMOtfdipaUeWEvGuAybL5NTdIJWH3x8F uSboGC9lK5gZYUyKqgPVnj5us8kZrb1Mjs5Zn9IkvGGGhJBrpU6qNo+hbvfDkc3UpI7R WBMY51Rb0HDOr7c/xiS0RPbHZSUM8YQQPzRzQhbAk/xR5Av82l3RKdZ3NH50rcnSZlLO 0SvvzIiXYc1nhviQ8hzFhM98DDCsWeCeH+6cvSifjvpIG+FQEOH4xRFFLgklXV2uxmw1 8QuE/ZzkRCw37RcaLMX7EFf6bJsNOiJ6qblSvZ2Mu/Oz95131tYY/UGoGxwoDrUxYgUC bKOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wjkJCXei3AfZYZPRaljdtTqcg7Eq3CUbOhFlN0MX8vI=; b=q+iTzhYIe2VEs8yrKiZXt0Vq95+hOTwNAxapT1GzHPlxGpxbjXa0NFDgYjHDL9Ht4P AEXi8kF3SANLEc+P8p7hlvd5baQc+3k2IHY0PEYpoir11GdYHZ1qAtSAnq70AW6uJqQh EJrwRwQLfynB6taoDC96CzJDFgFcoEhll9n2X1Hoife4pbRc99+OIDAvUyfUtAKXGtdm ypdukD4GaYN5fMoKG3s+wVVg1t6xhq2JqkpgSVup3yMJ1VyxNNM2QZ1la3bOQm/+MNSc 3echdlP7gwkkTE/8CvcjL6heezrbJMZS07V0yijay3PXtU00WbbFxiu32GhqWbs/Vllr P7TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=kF+5prut; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si10216721edw.582.2020.06.28.01.30.13; Sun, 28 Jun 2020 01:30:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=kF+5prut; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbgF1IaJ (ORCPT + 99 others); Sun, 28 Jun 2020 04:30:09 -0400 Received: from mout.gmx.net ([212.227.15.15]:54027 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbgF1IaJ (ORCPT ); Sun, 28 Jun 2020 04:30:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1593332952; bh=hOJe2Dl97VdPxKycDeziAd+nXQpgXsQroYTTcoE/0SE=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=kF+5prutYgh/ojChMkly43MvsPZjzllf21DKPyKHojBWnb46m+D7H03EktknbDHDk uOurR0PaAOpkTsPu2F6eUqdz5m2tzGo0O9jlglxkto6ROVoUCGvSPmL53TmVupb9SX YtfcfHwCjbP7DL7Hao1cRuP8jed5fSy2EIChSNx8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from longitude ([5.146.194.186]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MKsnP-1jWySo3TvZ-00LEs9; Sun, 28 Jun 2020 10:29:11 +0200 Date: Sun, 28 Jun 2020 10:29:06 +0200 From: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= To: Andreas Kemnade Cc: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= , linux-kernel@vger.kernel.org, Lee Jones , Rob Herring , Thierry Reding , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Alessandro Zummo , Alexandre Belloni , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Sam Ravnborg , Linus Walleij , Heiko Stuebner , Stephan Gerhold , Lubomir Rintel , Mark Brown , allen , Mauro Carvalho Chehab , "David S. Miller" , devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Heiko Stuebner , Josua Mayer Subject: Re: [RFC PATCH 04/10] mfd: Add base driver for Netronix embedded controller Message-ID: <20200628082906.GB2561@latitude> References: <20200620224222.1312520-1-j.neuschaefer@gmx.net> <20200620224222.1312520-3-j.neuschaefer@gmx.net> <20200627101738.2fe4abc3@aktux> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="b5gNqxB1S1yM7hjW" Content-Disposition: inline In-Reply-To: <20200627101738.2fe4abc3@aktux> X-Provags-ID: V03:K1:EYN80R10Ni3JCrJyeMviqBbci9FWV67OkIWXJtmMXrxey+sKk/R 9MEJ5n+ZLPxFZe2KOI+BmQVyl9jGiCdUlBp0u/Rs8ygy+H7o0NKC8otozyktJiuOf9SyKZA 9xQP1Wd/X6DTV5U8tXR8gkGPOZgBUW2Wj+b8W9nxgknV+gmCj9zGVB6l6+SIBh8nbgxQ6Au 09a/g4lfVcGRHLn2GOTtg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R1HNADA1CryJr32VF4DdYTl6SxW7jzsEMpRS7 ohAUP43zhPjprIXRPNztXXFeIgYfxCaoo774Vzw1X0foaBvwuaseou2Hx4VIXDJ1p7x/Yd12Q WV/EpD9DU8npNnwBm8llOrZIXZsGxGhq37+cmJ5PnqHdxTVQ0IMvoDDdbEJ7FKECrp95m3ax7 8qvZofJG42doUNvyg6LyTY+xI5oijQcidmAaRyxk8n1/ayxoVq1/uWFpMtYvKyBY89Ui77efg g0bvbSg/7CZbO8148qlqYAzI7PWiR2mXHhKvV6Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 27, 2020 at 10:17:38AM +0200, Andreas Kemnade wrote: > On Sun, 21 Jun 2020 00:42:15 +0200 > Jonathan Neusch=C3=A4fer wrote: >=20 > > Third-party hardware documentation is available at > > https://github.com/neuschaefer/linux/wiki/Netronix-MSP430-embedded-cont= roller > >=20 > > The EC supports interrupts, but the driver doesn't make use of them so > > far. > >=20 > > Known problems: > > - The reboot handler is installed in such a way that it directly calls > > into the i2c subsystem to send the reboot command to the EC. This > > means that the reboot handler may sleep, which is not allowed. > >=20 > see > https://patchwork.ozlabs.org/project/linux-i2c/patch/20190415213432.8972-= 3-contact@stefanchrist.eu/ >=20 > for a fix of such problems.=20 So far, regmap isn't involved here, but I'll remember it when I switch to regmap. Between when I first wrote this driver and now, the I2C has added support for transfers in atomic contexts very late in the system's life (exactly what happens when you reset a system via PMIC/EC), so this problem seems to be gone from my driver, for now. (See commit 63b96983a5ddf ("i2c: core: introduce callbacks for atomic trans= fers")) [...] > > +int ntxec_write8(struct ntxec *ec, u8 addr, u8 value) > > +{ > > + return ntxec_write16(ec, addr, value << 8); > > +} > > +EXPORT_SYMBOL(ntxec_write8); > > + >=20 > do we really need both 16bit and 8bit accessors? No, the hardware/firmware doesn't care. > If not, then simply use regmap_i2c_init and set val_bits accordingly. > Maybe just doing the << 8 in the constants? Thanks, I'll try this approach. The values are not always constants, for example in the PWM driver: res |=3D ntxec_write8(pwm->ec, NTXEC_PERIOD_HIGH, period >> 8); res |=3D ntxec_write8(pwm->ec, NTXEC_PERIOD_LOW, period); res |=3D ntxec_write8(pwm->ec, NTXEC_DUTY_HIGH, duty >> 8); res |=3D ntxec_write8(pwm->ec, NTXEC_DUTY_LOW, duty); Jonathan --b5gNqxB1S1yM7hjW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEvHAHGBBjQPVy+qvDCDBEmo7zX9sFAl74VL8ACgkQCDBEmo7z X9vsEg//cjP0FgATqceA5CjhLzEVJxxLCujFQN03O2AvzBf5EdlAzS+Rbl8vmTqw aGm+JAhI0gHbQgTni2UFe58LXIjCY6PG1weU2Zge52QLRIFsfKnh2qz9sAJUPBXD vrJOSTrlxBy7j4kAg4vsWpo1y0a+hg7NVzaV4VLtnhb7iEPjnbjgupi28gx2ak/P gJrVyIJOLMiHAOpJe+TiZPVUphklEBC/tLOZkq70vw6PElkemNNC9ajufmf2V+D6 kItW8NNCiOVXC6+1tklpoZlyttCPfVVv8XpTk+KtjEIghryk6aGbDxxD1HNOAUyz TqgtqsDwJh7Wr6YC6cDsiwD9YAzg2MvtplzHaOYpOEeXRT2ZjUxtz4MJ5YdxaXfl QApB1HpUzZvAECUOO4tRR+Olq1rB4y3g3pjn+NEH7XtKZiokxtT/8iCvcHIkIwLG LFiQ7E2Lha6nprVbGyiCG1l3uz8FZtqdrHzXxeVkkMvvFDSWXSNWKGogw6/SNGTc vB8tkxixvppfKlbS2j4kBXe1griaqSFPC6epS9VT1NpNGecekg+5M+6OEm+LTq+v XI4kTNYHd9GacgNzLbSQG3p0nNg6YGdyYXXID5jArsVOPbRThclnNLDajEQ9r2IZ 3DAjcL/TTRxwmCiAFAoNMVRnBvGOxyrWJ5YuLslonkne5i2lAFE= =7+bu -----END PGP SIGNATURE----- --b5gNqxB1S1yM7hjW--