From patchwork Wed Jan 18 15:48:15 2023 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: 4184 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2413252wrn; Wed, 18 Jan 2023 07:56:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXu1PA3zMmo2qNYPpRyIN9WbK7n9upd7oFRxgoRDTK/dM9SSrQxKEpYz4YeUGjJ2NetbKRCs X-Received: by 2002:a17:907:a4c6:b0:86f:1283:7b1d with SMTP id vq6-20020a170907a4c600b0086f12837b1dmr3961767ejc.71.1674057400508; Wed, 18 Jan 2023 07:56:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674057400; cv=none; d=google.com; s=arc-20160816; b=Q1zf204PCh6G8UUe6vw6W66t0A+VpEDncetqdhArTWWn7pK5dtx3KKnRw+CytC/ZBQ 0LGBZa10nYyRzre8+Dc8yidiGRVC+ccKqC7McnsJESpc3COCaJt5WFvOkR28SF0UA8nR un1uApDMJphCpROJapU6X5QIrxFZftWfgiZZaJpEGoH1pmpBqJb588ZbEse+cJfTXQke ddfU3m4XEzHCjUU33adT2CjJwbU/9gNDYyA1fe1ovdrje/ozHde2WoJuoIpvPlTDXoRl 3MxxBjhoX8+1OlflyZTOx1DqY7ISThWkxcf/WHwWGYQqoRU2bAVhXLtZtFos7ndX/6ns sWDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=7W1xrKOtmXTVP6QwRberC1lSXotXm9Cyj8BIFgT7R6I=; b=vm5WHszLic3u6lU/yBnBNQjsVLj98X44m61Sc+HE9hVVsRVS5scosXtQIKko0BQ1Sr 7LbR7DFbUDtZalaZQHQ+sthGKDb99WDa62sVAQU0i5OzHEqVTjcMnRDorqz6Zx3N00nj kONoS/7O8g1TboyfPrvWQj2uwVnR/ALM/qgManKfUpe3cdx4RZSKO9XvacEgS+heWG67 2ekcPi+ELQgzvUc5cnoHp0/JCA6onlNktK6J0JK8x0YczroC1C4hCbr2kjH59MU+/o5D iA4iH/Eyov/iWdQ56FSNWdqDwwmVyK3m4lHWctuZQVkBJUDMGv4W6VHCCsHf8qqT9upV +IDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa31-20020a170907869f00b0086ffd881d1esi12109189ejc.290.2023.01.18.07.56.16; Wed, 18 Jan 2023 07:56:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229618AbjARPvF (ORCPT + 99 others); Wed, 18 Jan 2023 10:51:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230254AbjARPuF (ORCPT ); Wed, 18 Jan 2023 10:50:05 -0500 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 6DCA3366A5 for ; Wed, 18 Jan 2023 07:48:26 -0800 (PST) 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 1pIAfo-0000Ak-3e; Wed, 18 Jan 2023 16:48:24 +0100 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 1pIAfm-006wQ3-Vy; Wed, 18 Jan 2023 16:48:22 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pIAfm-00Du2d-DP; Wed, 18 Jan 2023 16:48:22 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding , Linus Walleij Cc: linux-pwm@vger.kernel.org, kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] pwm: ab8500: Fix .apply() and implement .get_state() Date: Wed, 18 Jan 2023 16:48:15 +0100 Message-Id: <20230118154817.97364-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=809; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YAs5YAq6L7laZZa7NvQbZ3lbUvzorsFuGiH7G8PtkAk=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBjyBS0DS/Lc7+pPhOwGoTq6ziMwIifwC/BcMZ9ZThi jIIvMVWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY8gUtAAKCRDB/BR4rcrsCcM+B/ 9F35rkNzyK4z7CSA3dVCnWn7JNPBT9C4Rz8jWnqRMR9MrYKC3GfBK9hDljY25RGoOErIY90UErRZu0 dpbZYMR+dJXrXchxCpivTJYLkN/8yFIVVXNmQSUm0m5G4JEmjXUsxkcSDNNcCGY8RZmRFvMiCBcbZw tOsZkxgMkM4QUbPWCknxQtd2KpUn0TmoSIT8yfvAn2rYbZCSfBSaEHtzL01SqF4E0wvpaxE2OVOKrM XUxke+ZhAky6ExClZ2vAdqQwKXxrLFwgkPO/Rr4GGkslvbclhYkw5k0wnjyizAk4JYIQBpKVJhCONO Sc+POkVTO3pfQB1S7irJ1luReKvBRq 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-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755376412816995360?= X-GMAIL-MSGID: =?utf-8?q?1755376412816995360?= Hello, during review of my previous pwm-ab8500 patch I learned that there is a (somewhat) publically available reference manual. Reading in it showed that .apply() is still more broken that I assumed by just reading the code. This series first fixes .apply() to not be off by a factor of ~3000 and then adds a .get_state() callback. Note this is only compile tested as I don't have the hardware. Also note this breaks all consumers that relied on the previously broken behaviour. Uwe Kleine-König (2): pwm: ab8500: Fix calculation of duty and period pwm: ab8500: Implement .get_state() drivers/pwm/pwm-ab8500.c | 112 +++++++++++++++++++++++++++++++++++---- 1 file changed, 103 insertions(+), 9 deletions(-) base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2 Reviewed-by: Linus Walleij