Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2671361pxb; Mon, 11 Jan 2021 16:43:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGrf4OQzxW1RZOHPvcRFoUAFVu4kBp8/GYwFeI8xlAr1p3Mm4lOvgEehniyiZNe/ja/AZP X-Received: by 2002:a05:6402:366:: with SMTP id s6mr1366771edw.44.1610412235727; Mon, 11 Jan 2021 16:43:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610412235; cv=none; d=google.com; s=arc-20160816; b=lqhHbvINMPWswdF/Ph1fMB3KYUDe6ZYxEhm9+nedDc2B7ugZpr2ucG5Svhi6uGmlko Xn3F6yIasLDGHeWW4Pm+FSJw3oqKBvD4LteoMR2P5s6kvGPEsrTJaSOHC9SVKRz/ppJ6 66pM5Yd8XY7Ooy0Z5MalPvoQ0KHdv8N0GGTLXWpwF7Sb98mPiS9znA6JctiFPxWxZD5L /qxGXlTa2a+RMugk06nL+1O02E59QdqhecHmlZsGAzV2nRyqGIlVzVDpjooeIecVLMs/ vQDiYUMNUNX3gMGWh7TW/9GTYC2TvwvHQspMBHRFeQQ3826hACVjiJHkEUz3wmCPNktP xM1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jDh7bR5KL1i+zrcnAe+RgQgH4cW7c4bLFBL7OnmiPNg=; b=GH2cg9X9IgNEj0c/pcjh+yFavtf8JHMTtmALs4Y4EKpgZL+b5quBKYEFENE8j6Zi5Y swoUm7t6k9A1CFlSCJCzg4BAQanNc11y/egdzmF/Waot0OlYZoMhB2FsgHhJqp55/utl BpxEB396daG7Ll6nkXA/lhoNmvaLQPCK1cFvdqjpbkbXDeBxNGiyV5t6S8PAJ2+SygDr gZkot2Gd99EguomEWUngouJOQCAy+Ou3X1KtzRsurQehVA/k48oQCLQ1YbmbH/On11GD 9AvftHxJskmM9FAg8sccKGUMkY/VO0/s73l7aupamdhi9UsSYop37uBfZG8mMEACQR8k H3tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NlLdCIgl; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si101815eji.465.2021.01.11.16.43.31; Mon, 11 Jan 2021 16:43:55 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=NlLdCIgl; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727315AbhAKMyl (ORCPT + 99 others); Mon, 11 Jan 2021 07:54:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbhAKMyl (ORCPT ); Mon, 11 Jan 2021 07:54:41 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73436C061794; Mon, 11 Jan 2021 04:54:00 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id a6so13731867wmc.2; Mon, 11 Jan 2021 04:54:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jDh7bR5KL1i+zrcnAe+RgQgH4cW7c4bLFBL7OnmiPNg=; b=NlLdCIglQue47msebGNg1KLuPv6LZbFfyxII8Slx8pBwyqBPa6ls5HoEi70qPLQNhO m2xDgGfL0Ftld8qKSac48KG0MOYTfqa94Ix4DPTyl7LrTKTDQiwR4i9RJAVd3vVOownF Ofg9RGCRZWDtUaXXb+sTyN4d7Nh8PAnw1oqadWXBj5gGdPDbNeJZy+LlIaJuuQpGvUci ZUNq0g/+XjwYLjWZB0gKxTEwWFnDuWdghk5mxWeDAEXqawf1/7zwObw2DGRRtHk1HDR0 lTTJ8zgk+hKBLK1gbFxfVZ3MNzmXJwZSKz7Hb5u3c4EzcDtre+MoDZq63sPJvL47Ne0I uX/g== 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:in-reply-to:user-agent; bh=jDh7bR5KL1i+zrcnAe+RgQgH4cW7c4bLFBL7OnmiPNg=; b=l35ww8JNfsLXhc7xkGqNn+rZEZOj8mU3si9e+QyO+fcXI+QSYdCihVTFtAo2F6oanj o++2pECcsNplF8iHPi2dpwWjSnbFJ2sc/DxpLxQk4vMo75bfQHSmf87Afm9Osk0uEvop Jp8fGXmOWRw0HrBCFEKP0e5qdNXg9nyfFNrVkjhDNa36fXH1vxJcEV9iiRrsImCixnYl 8wJlN/t8XgIAnEhvkuyDDnrEkScXbHJwuhGCnBasoFOhHQ1YR+U+kVkL2K2GFAoJtULU qcLdN/zZLmnKnwJvUkYRv3xQNYgmbC6OOOXclSnstfhPtTcEhKzdHmtXzB/euqtgCuOV i0Xg== X-Gm-Message-State: AOAM531wy2wzvHWESrdgJdIGzDr/51PT8z8Fu+qFj9k493LPEt4o3Ahq I1rbX2fJGhGMW5EvNqOO5rE= X-Received: by 2002:a1c:2605:: with SMTP id m5mr14595416wmm.111.1610369639184; Mon, 11 Jan 2021 04:53:59 -0800 (PST) Received: from localhost ([62.96.65.119]) by smtp.gmail.com with ESMTPSA id y2sm21195511wma.6.2021.01.11.04.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 04:53:57 -0800 (PST) Date: Mon, 11 Jan 2021 13:53:56 +0100 From: Thierry Reding To: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= Cc: linux-kernel@vger.kernel.org, Lee Jones , Rob Herring , 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 , Andreas Kemnade , Arnd Bergmann , Daniel Palmer , Andy Shevchenko Subject: Re: [PATCH v7 4/7] pwm: ntxec: Add driver for PWM function in Netronix EC Message-ID: References: <20210109180220.121511-1-j.neuschaefer@gmx.net> <20210109180220.121511-5-j.neuschaefer@gmx.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="z0ToN2/Ipg8oub5U" Content-Disposition: inline In-Reply-To: <20210109180220.121511-5-j.neuschaefer@gmx.net> User-Agent: Mutt/2.0.3 (a51f058f) (2020-12-04) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --z0ToN2/Ipg8oub5U Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 09, 2021 at 07:02:17PM +0100, Jonathan Neusch=C3=A4fer wrote: > The Netronix EC provides a PWM output which is used for the backlight > on some ebook readers. This patches adds a driver for the PWM output. >=20 > The .get_state callback is not implemented, because the PWM state can't > be read back from the hardware. >=20 > Signed-off-by: Jonathan Neusch=C3=A4fer > --- > v7: > - no changes >=20 > v6: > - https://lore.kernel.org/lkml/20201208011000.3060239-5-j.neuschaefer@gmx= =2Enet/ > - Move period / duty cycle setting code to a function > - Rename pwmchip_to_priv to ntxec_pwm_from_chip > - Set period and duty cycle only before enabling the output > - Mention that duty=3D0, enable=3D1 is assumed not to happen > - Interleave writes to the period and duty cycle registers, to minimize t= he > window of time that an inconsistent state is configured >=20 > v5: > - https://lore.kernel.org/lkml/20201201011513.1627028-5-j.neuschaefer@gmx= =2Enet/ > - Avoid truncation of period and duty cycle to 32 bits > - Make ntxec_pwm_ops const > - Use regmap_multi_reg_write > - Add comment about get_state to ntxec_pwm_ops > - Add comments about non-atomicity of (period, duty cycle) update >=20 > v4: > - https://lore.kernel.org/lkml/20201122222739.1455132-5-j.neuschaefer@gmx= =2Enet/ > - Document hardware/driver limitations > - Only accept normal polarity > - Fix a typo ("zone" -> "zero") > - change MAX_PERIOD_NS to 0xffff * 125 > - Clamp period to the maximum rather than returning an error > - Rename private struct pointer to priv > - Rearrage control flow in _probe to save a few lines and a temporary var= iable > - Add missing MODULE_ALIAS line > - Spell out ODM >=20 > v3: > - https://lore.kernel.org/lkml/20200924192455.2484005-5-j.neuschaefer@gmx= =2Enet/ > - Relicense as GPLv2 or later > - Add email address to copyright line > - Remove OF compatible string and don't include linux/of_device.h > - Fix bogus ?: in return line > - Don't use a comma after sentinels > - Avoid ret |=3D ... pattern > - Move 8-bit register conversion to ntxec.h >=20 > v2: > - https://lore.kernel.org/lkml/20200905133230.1014581-6-j.neuschaefer@gmx= =2Enet/ > - Various grammar and style improvements, as suggested by Uwe Kleine-K=C3= =B6nig, > Lee Jones, and Alexandre Belloni > - Switch to regmap > - Prefix registers with NTXEC_REG_ > - Add help text to the Kconfig option > - Use the .apply callback instead of the old API > - Add a #define for the time base (125ns) > - Don't change device state in .probe; this avoids multiple problems > - Rework division and overflow check logic to perform divisions in 32 bits > - Avoid setting duty cycle to zero, to work around a hardware quirk > --- > drivers/pwm/Kconfig | 8 ++ > drivers/pwm/Makefile | 1 + > drivers/pwm/pwm-ntxec.c | 182 ++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 191 insertions(+) > create mode 100644 drivers/pwm/pwm-ntxec.c Lee, I assume you'll want to pick the whole set up into the MFD tree? If so: Acked-by: Thierry Reding --z0ToN2/Ipg8oub5U Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAl/8SmEACgkQ3SOs138+ s6F/3A//SWDNFJM/BhmTosI1HQsrkThdPJ11VkCRyPXOQS4HAWN4ks5Lkds6b0yo 90Pv/UecjXvliFivSNcUeXNUOLeVIm3Wy37/H9D3obOayyvssEaPpv5HYYQ2HkUW 4km3iHOvxG2hD3s0K6FoCPcTIzp3BgVSn8D3TZr+xXlVPEijevLwAtd7h9SYQDLy f7Eie32+fGLfM/hxDKIfz6gBhL5b1DlWP33RjOtMVVjUvLao1z7rOZGw3BU0Y6MP z+jDt4b8YKyJ0npSpCOD6ZzOQiynWYmi6+cCbza6C43/o6B9nW+loFBtUcNBg75J ft++3twZkMXGmdGWoaPMZdxYE/kiO1jmfxICWdJHEeRC4+VUJylNqpkZHhApsd2y IQBECMBXfdOVVv6xDTM7wyYlGlbHWeDyK4ak21HkLEWucyKx0q74DKujCtONJFCQ 0YRiGVSa1/8tSLOmq3slq6qlx8O30l6yPXyvrHXHozZRqeAjBSGowAIjYfzJX0KC ik4nyuMOnLqV2Up0hjYForCaQkVyKd1RRDR7iG32ujuaje3v7jOiKHC6+PNbLRmt iL0nhcROYuTlIA4ubZIusiA8Tky2HadiG6mK56RR6eFA3FDY6OdWqxOPZskhbfzZ RL66muGfOuKGuNZNHjawwUhozK8Nopkp74nYDxIesQU1dfn/1kA= =XjN2 -----END PGP SIGNATURE----- --z0ToN2/Ipg8oub5U--