From patchwork Wed Apr 20 12:12:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12820155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5064C43219 for ; Wed, 20 Apr 2022 12:13:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352770AbiDTMPs (ORCPT ); Wed, 20 Apr 2022 08:15:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352746AbiDTMPl (ORCPT ); Wed, 20 Apr 2022 08:15:41 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E0FC403C6 for ; Wed, 20 Apr 2022 05:12:55 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nh9CT-00022F-QD; Wed, 20 Apr 2022 14:12:50 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nh9CT-0049d6-GR; Wed, 20 Apr 2022 14:12:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nh9CR-004TjM-6T; Wed, 20 Apr 2022 14:12:47 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Simon Horman , Geert Uytterhoeven , Magnus Damm , Thierry Reding , Lee Jones Cc: linux-renesas-soc@vger.kernel.org, linux-pwm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v2 0/6] pwm: renesas-tpu: Various improvements Date: Wed, 20 Apr 2022 14:12:34 +0200 Message-Id: <20220420121240.67781-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1220; h=from:subject; bh=opyfJ7S5Ryxq8QbdPqxRSrC9QkGpuJslluznrZ+FBbw=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBiX/ifjLukT+1ISHUjQ98UEVjMqkzR5uDe0RrqBSDP 8SPM6G6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYl/4nwAKCRDB/BR4rcrsCaEmB/ 9zazWz6PUUTFaiN2N5wIhBHSWWIwNvHKXUVH5j/Ghq+EVL6bz3QylH1ZudOFgVCPnb9vI81dobFHBI v66zEI2AbsvnA9H92dmZ8sjIsHuhbQQgH29hJQfHIm2roeAne054lDs4EiESkkM4a12OhXJAkWtl46 VyUUhApnDBx1krVa2vS5j9VMFGRQFIpPgDwqiCya2Du/oZ6gMbg+ZucuVhoUDzB+rW/LyaOLADEuG1 1aQfTOvQ+lf53OeolyxI7Ml5M4GvYV6z+uoKXKUM9n8aVCCiwhEzneo7rPePNWw8qeIJFIa+VK6gdo vMQQWMhMtoJs9kZgGOfUcYTP9UACqz X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Hello, I reworked the series to improve the renesas-tpu PWM driver after feedback I got from Geert. The changes are: - Add Geert's tags for the first two patches (I didn't add them for the other patches as I changed these enough to not carry the tags forward.) - Use tpu_pwm_disable instead chip->ops->disable (which is NULL now) fixing a crash in v1. - The calculation now uses a switch instead of ilog2. Looking at the compiled code for ARM this is more effective and I assume the same holds true for other platforms. Thanks again to Geert for his valuable feedback and testing. Best regards Uwe Uwe Kleine-König (6): pwm: renesas-tpu: Make use of dev_err_probe() pwm: renesas-tpu: Make use of devm functions pwm: renesas-tpu: Implement .apply() callback pwm: renesas-tpu: Rename variables to match the usual naming pwm: renesas-tpu: Improve maths to compute register settings pwm: renesas-tpu: Improve precision of period and duty_cycle calculation drivers/pwm/pwm-renesas-tpu.c | 317 +++++++++++++++++++--------------- 1 file changed, 180 insertions(+), 137 deletions(-) base-commit: 3123109284176b1532874591f7c81f3837bbdc17 Tested-by: Geert Uytterhoeven