From patchwork Wed Sep 7 13:12:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 12968954 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B14EC54EE9 for ; Wed, 7 Sep 2022 13:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=PBU9Pi6MJL1CZ5oU3x5He4ykLWB4zxyXz98JitGtUxU=; b=IS0iq7U3YAQwNh DU50+D8wdh4HM93IGL756fRdcRDlndtpGqdTVvVfzNG7UZa0+xUGZm9bLPdDSYH3u3fusDS6GD9Fp Fa4qyCMYB1wfQmaHSg7dhV4w2VLjFgWMwNUQX8XAnZdHoxf/PCrBEiABuPkXWpIdiU0u90WIGGozq /xLwYMxgVASv2Gv0XwQU7ZARdpUvSeVqI2MrZZFe2wyP6y93U87co7e31NMxicISAK+keZM15CkjH OBOLh9bcBOllcI92I9ZBA/zQcLFCZvITkk1I3NRvb/UtXszej+F+nKlWByURhsxumy30NjsOd1TeG ROsdAJiOocdUOrgauFZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVurb-006O9A-EL; Wed, 07 Sep 2022 13:13:07 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVurU-006O1J-Gz for linux-arm-kernel@lists.infradead.org; Wed, 07 Sep 2022 13:13:04 +0000 Received: by mail-wm1-x32e.google.com with SMTP id ay39-20020a05600c1e2700b003a5503a80cfso9487307wmb.2 for ; Wed, 07 Sep 2022 06:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=ynCgB3/njUUtikJbNwwFb27dQMoAVrUmbX/w5/0BTeA=; b=WRVYYcfUhTkxkxAptbak95eCopWgsjEwvL/n2b/7aR6On4JZ7gXXmtPgYHvDu10kI4 9jD6TZ87MciOTekZ7S2y8hruk/3N+bixI7WGc0sq7DfaYlnatujOYB1/62HazOZzNACg vKzP6MtlfyEFDmZ5t9tb08Z3OLPy248FgcZMw2TyPOelQKlmFm5msb38zn7pbZRxhDij TZ2FXnSv/4YAfrrPBV+VY6RKPCKvhwkPsDxkQkcnkq3MKOQ3RdtAf/+X1TtUIGlUPATp i+yCrj75IAJrZCc/eeNDkqzegpFRS7jJ6VhAtwGLmUojnh1wD+2bZmM0N29tA7bEKN9s GV+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=ynCgB3/njUUtikJbNwwFb27dQMoAVrUmbX/w5/0BTeA=; b=NlqzfK67MmUJJDcd0s+165ng8w2i0rEa4ulCGQb/Zm2cmrMxvoqjEzquux1AywS8Kd Qn1wIkwjOocQ5o0KQdEImhcR7i+WiShwbnkPuMS/OMKypOt1kdLBP5nJGZQEeEfykges yGGzEw4/yJFaO759OaoGUPHMwMj3aXByfawadSAUs8KWmNXMiZwrQPcJRrqsBYSTW+vl DDQ3RU3CaGDFTzwkCg+Rz7N0fbk2TYFZmAyFBIoz5TvozBYftHkxCbkuNBcG0dZfv9Rt Qcz8UURl/faGgfsL2hH1UY9V3seP4QYQOznLHFuG/TthI2TnximquVTgsAP/Lgc6mwp6 iixA== X-Gm-Message-State: ACgBeo3VjxSxH0wwTG5zPbvRULCzN/xCCgCmG11iuy9mJuJLvEYHIz7d uIhCLZ+CI8CLjcsKybYPAtQ= X-Google-Smtp-Source: AA6agR51blRYnP1FdPWL5S6gbaY0mteO+Mdtv37DibtneVcbmfJ/3+zkurHVXskg/s9vJ+Jq8l+q2w== X-Received: by 2002:a05:600c:4207:b0:3a7:b53f:d6e2 with SMTP id x7-20020a05600c420700b003a7b53fd6e2mr17042881wmh.116.1662556365734; Wed, 07 Sep 2022 06:12:45 -0700 (PDT) Received: from debby ([2a01:e0a:a6d:a8d0:7ff4:8f61:5574:9f95]) by smtp.gmail.com with ESMTPSA id az24-20020adfe198000000b00228619a097esm15102018wrb.49.2022.09.07.06.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 06:12:44 -0700 (PDT) From: Romain Perier To: Thierry Reding , Lee Jones , Daniel Palmer , Romain Perier , Rob Herring Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/5] Add PWM for MStar SoCs Date: Wed, 7 Sep 2022 15:12:36 +0200 Message-Id: <20220907131241.31941-1-romain.perier@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_061300_587402_A1E79CA0 X-CRM114-Status: GOOD ( 17.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patches series adds a new driver for the PWM found in the Mstar MSC313e SoCs and newer. It adds a basic pwm driver, the corresponding devicetree bindings and its documentation. Changes since v1: - Fixed commit message for the dt-bindings doc - Removed "OneOf" from the dt-bindings doc - Re-ordered alphabetically in Kconfig and remove unseless empty lines - Explain and adds comment in _writecounter() (hw constrainst) - Reworked the msc313e_pwm_config() function - Fixed clk handling - Removed extra callbacks, only keep .apply and .get_state - Implement .get_state completly, this fixes the driver with PWM_DEBUG (the whole driver has been tested with PWM_DEBUG). - Dropped useless lines in _probe - I have kept regmap_field() because it is more clean and helpful, it avoids to do too much of offset and mask and shift all over the place. Daniel Palmer (1): pwm: Add support for the MSTAR MSC313 PWM Romain Perier (4): dt-bindings: pwm: Add Mstar MSC313e PWM devicetree bindings documentation ARM: dts: mstar: Add pwm device node to infinity ARM: dts: mstar: Add pwm device node to infinity3 ARM: dts: mstar: Add pwm device node to infinity2m .../bindings/pwm/mstar,msc313e-pwm.yaml | 46 +++ MAINTAINERS | 1 + arch/arm/boot/dts/mstar-infinity.dtsi | 10 + arch/arm/boot/dts/mstar-infinity2m.dtsi | 8 + arch/arm/boot/dts/mstar-infinity3.dtsi | 10 + drivers/pwm/Kconfig | 10 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-msc313e.c | 269 ++++++++++++++++++ 8 files changed, 355 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/mstar,msc313e-pwm.yaml create mode 100644 drivers/pwm/pwm-msc313e.c