Received: by 10.223.185.116 with SMTP id b49csp8908801wrg; Fri, 2 Mar 2018 09:59:34 -0800 (PST) X-Google-Smtp-Source: AG47ELvq6YtiPOA3I2YZE9ELKLtDV1FZBKCF4NiAknDXfIMSfssQM3CJ4Bcc3SPp5W9naN57zw7E X-Received: by 10.101.68.193 with SMTP id g1mr5079810pgs.302.1520013574786; Fri, 02 Mar 2018 09:59:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520013574; cv=none; d=google.com; s=arc-20160816; b=UhXwZaIl2lbrMYdLOMpewlNVqoLpxtPL9askGqgFSuIzsDklqYIu7u+daBr86vzNIY 8+xX89CQl6KfG52d1JmffFP4SZ2AfBUyv2HThYPMmTizNze+jTkZ+y8H/zg45NJ39ZIC O7m7TIQKLXLjw1PSnD3VAqsKqsazR3YD87xrEKMD/1nvwtRDp+pbati1Y8IgaX6kKkXe jqhPljiWsxJO/VNPpyOMxdqfBukvC8Wues1KWrTf1XEtlc9y6P7fkcYbLsB/sc5CRwcd +1WJzQT9Zf8YrDxhNAQcbCISIXlTBTUgWyw80VVTkXJkzh7dxTTyyvtQusybrLlL0kcu Od+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=92YiDD5ShZ+Qncy3W+ZPH9RxGveo3TCUBuYYe8ZIjRU=; b=uZFP5aZmaP5SjQZsxkqobcRqgbjgId9+lZQHcsHDjtBrUtTHWun9eEXOtdC7R8HacG SnyIMcpcqybXiWq9h8bMdiktUvjNsyDPnVS+c8G1UGd2dKo02eSNPt+fP5MufS4u245V b08ht5ij0wL1sL8aacR3Nu9+7YGb1FvUBeOmKWgZwJkXiodY4liWaTfW4pyM1VM6cFXE 37+THALBkXSSOzkBIHB2H2CSIKcd3Kjw57b8hyAK6s30iBw42WfPzGMYnFrC7AUg2fbj K965KADIwMDtBxflfu+vkIRTmYqC/yz0ZK6ewW4WQDO8cll0frf31+n8P6j76h0aP56R a09A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=STRXvXXw; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7-v6si5103456plz.752.2018.03.02.09.59.20; Fri, 02 Mar 2018 09:59:34 -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=@gmail.com header.s=20161025 header.b=STRXvXXw; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426797AbeCBK5d (ORCPT + 99 others); Fri, 2 Mar 2018 05:57:33 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:37992 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423941AbeCBK5X (ORCPT ); Fri, 2 Mar 2018 05:57:23 -0500 Received: by mail-qt0-f194.google.com with SMTP id n12so11339432qtl.5; Fri, 02 Mar 2018 02:57:22 -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=92YiDD5ShZ+Qncy3W+ZPH9RxGveo3TCUBuYYe8ZIjRU=; b=STRXvXXwUnK4ljsLwTSL4+dKlzlAGCdt+V3gVwlZcLfWh87aUeQm+e8bnyFP7VS0YE sqZdQYjGPE7sqSkj28MPlNNemnjy7CC8G9pfy6DOqZ4rvmnolRAfGBic713gNOFUP84o wwbVTeUPeTO9lEdQlKG9kvEuDZE/GxI+vsFrHpZ96Slt7EtEhgJNxx+t3RcH9sYV5l9I GQ39wylpRbbqOd3l7O6AvT+mrKUgPuvcZcxXVKf+jW8/1mcRSkuNc0GWyJ1UVVHW0Kmh ifLGKM66qAmXQzNUj6ULgv5o4pLrcR4qT7BZKIj7LrEWVW8PP8wgxqCMebwuPxolrY9f F0qg== 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=92YiDD5ShZ+Qncy3W+ZPH9RxGveo3TCUBuYYe8ZIjRU=; b=U17A0k83PYf+sF2dCEfo3ARJd0HBZsyX/kamCPTyHvXLZrZfjAmDBOuJP7+/cW/Q0G pi3Yv5tNqG7na249arsYYIFirSeUya/K7Bt0WxK92gZ14abjTzZC/09YZM6TEHbGi4Ja C/oAsCPpeJhxwFelMxes5h1/hulZIXWGh+11Q9tlgLrtRfUE5A9Y8cD8UJJBRaDLskPr O0yxZf76hctCUVml8E71owSvWg2K3Ek2QEzgxz7GD6ajvZb/wNSf+RtFeSfunzjBQ/9D k/kh6WOT108+N0FhF1MwxKlKKgyYWPsouctb33ROCXGI3U5XLN6vPEB9PtDOoe5XbylJ KbAg== X-Gm-Message-State: AElRT7GyYr3g3DOZPnwLILn/rRtYI3tIDUlQbn/J2ZgWARNdQRlGN4Kf 5fByykSFy/bl3pifrnlCwvc= X-Received: by 10.237.33.170 with SMTP id l39mr8206139qtc.100.1519988241896; Fri, 02 Mar 2018 02:57:21 -0800 (PST) Received: from localhost (p200300E41F1A6C00A7FFE15449086C5C.dip0.t-ipconnect.de. [2003:e4:1f1a:6c00:a7ff:e154:4908:6c5c]) by smtp.gmail.com with ESMTPSA id 3sm4090651qke.24.2018.03.02.02.57.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Mar 2018 02:57:21 -0800 (PST) Date: Fri, 2 Mar 2018 11:57:19 +0100 From: Thierry Reding To: sean.wang@mediatek.com Cc: matthias.bgg@gmail.com, linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Zhi Mao , John Crispin Subject: Re: [PATCH v3] pwm: mediatek: fix up PWM4 and PWM5 malfunction on MT7623 Message-ID: <20180302105719.GC27178@ulmo> References: <051f401bcca48ece188023ccf10b2cedc7a25a64.1519891948.git.sean.wang@mediatek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6zdv2QT/q3FMhpsV" Content-Disposition: inline In-Reply-To: <051f401bcca48ece188023ccf10b2cedc7a25a64.1519891948.git.sean.wang@mediatek.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --6zdv2QT/q3FMhpsV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 01, 2018 at 04:19:12PM +0800, sean.wang@mediatek.com wrote: > From: Sean Wang >=20 > Since the offset for both registers, PWMDWIDTH and PWMTHRES, used to > control PWM4 or PWM5 are distinct from the other PWMs, whose wrong > programming on PWM hardware causes waveform cannot be output as expected. > Thus, the patch adds the extra condition for fixing up the weird case to > let PWM4 or PWM5 able to work on MT7623. >=20 > v1 -> v2: use pwm45_fixup naming instead of pwm45_quirk > v2 -> v3: add more tags for Reviewed-by, Fixes, and Cc stable >=20 > Cc: stable@vger.kernel.org > Fixes: caf065f8fd58 ("pwm: Add MediaTek PWM support") > Signed-off-by: Sean Wang > Reviewed-by: Matthias Brugger > Cc: Zhi Mao > Cc: John Crispin > Cc: Matthias Brugger > --- > drivers/pwm/pwm-mediatek.c | 24 +++++++++++++++++++++--- > 1 file changed, 21 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c [...] > @@ -151,9 +156,18 @@ static int mtk_pwm_config(struct pwm_chip *chip, str= uct pwm_device *pwm, > return -EINVAL; > } > =20 > + if (pc->soc->pwm45_fixup && pwm->hwpwm > 2) { > + /* > + * PWM[4,5] has distinct offset for PWMDWIDTH and PWMTHRES > + * from the other PWMs on MT7623. > + */ > + reg_width =3D PWM45DWIDTH_FIXUP; > + reg_thres =3D PWM45THRES_FIXUP; > + } I don't understand this. According to the condition above the above would also use the PWM[4,5] "fixup" register offsets with PWM[3]. Should the condition be pwm->hwpwm > 3? Thierry --6zdv2QT/q3FMhpsV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlqZLgwACgkQ3SOs138+ s6FX2w//SIhj+docsdzcwMIo27Gc2qmUL1sMCZXhB8dEGZ8CDXRDRyGsNE/eCkkD 5bZrN3ie7XkkcoLjDqhJZM5PvsiqR4367yRlWg5N/PsCwlji0wZ/1ZfV0bxBxa7G k9A9aJt4PdRAzT6gJh7IQmbnlMvbHN1NpkSli5HYrGtEO7t0MewAPRjJ8/KIcscI IlXX6ESptOP3+3xbu21dOzxV3T2zmlPKQmUIfDLH9PkcC4RYOuANbkWb0em9hpeq dJtLSqqwXh3WSMjRgJpKIT5qiKhuuiQRoWJyUkImQfjU5kH8QC89/yVNUXcNo3pT NvZ5cqihFktL+dLd+qS+nIxh2VQDF+NLHD0G8OBlYtSe/X44NkPtS+gOMBYDSKLJ L3g0REZRfQXK2QtWZ818acUnd/MC9E5x2O3C0VVh/YzIEzUr6qKTstk33+QX7xUc 6kLWtO5ctV180OdiyWW0qE/v8ZoioY/KTeNQU5Mgfz1YMEkhSP8wSLLRBMknJ4+n n7CE172HhAUGsbhYA2/eRG9e8vnTyk4fdWrcjryRoxtjGGsG2JTOkOj5x0M5XR3o b6O2JQXS8hGJXBzjK7/PtKnbXc8hMjRFT1HcZ4z4ztNnaSufCEdKPWlXRLZQs0ix 2PAvnqATUdF3IegKJZSmWJ5joIT/kJu7JmmzXM2GoOM9FAUNZ18= =4k2G -----END PGP SIGNATURE----- --6zdv2QT/q3FMhpsV--