From patchwork Wed Oct 16 00:19:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chen Wang X-Patchwork-Id: 13837471 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 11298D20686 for ; Wed, 16 Oct 2024 00:19:24 +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:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=P5IOqN58S80MU1kIrSGLY4pXyKMB0Pm2h1JQkBBP9Ik=; b=5Bds38ccVfJoGj JstuB0FNPItWHu0A2ZZ+dVJPZvbzxyBZYWZyyo4pWY+Zz/EvsIuA0hht0lFh2wEA9qN4FcsZmRFQ5 bgXeVOASE5V+3r14R15zjKZ7Z1t4w6P7A9EumZqPQgBi21JNvzv2uN8RrsGRKwFe0i3tlsMpqWMi6 4Hp7YQOdS+v8w2xRRw55F3LihKJsjBUz5HwcWhc+fRbJlg/Q9NO5Z/EwmqhBZG1YqoaaaZVlvv921 IO4MWC1skvfSANwF8IJrcgYVdN8kKGfVtdqgNzhSebaAXe0wXw5ycQPtysosYUVkHSyDmy9u93t1t 6HDPWlbHF8dlPGu5mbGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0rkz-00000009zeX-3A3I; Wed, 16 Oct 2024 00:19:17 +0000 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0rkx-00000009zeC-085A for linux-riscv@lists.infradead.org; Wed, 16 Oct 2024 00:19:16 +0000 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-27beb2496f4so1594578fac.1 for ; Tue, 15 Oct 2024 17:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729037953; x=1729642753; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=05Y/2FGPgyvbyYFbGsJUnsosQK0HSJiBFrb2Qq6aVrA=; b=ZSenheQGm49sg18HEQ31HureBdhS7YYLi//mAzYR4EI2O9F2PtxThS5fEhotzmt0Ye rImoXT9bT4j0i8ubvMcq+CnyaaiZkuPkwctJlyhBlz7dU6RlK868PhggY3tzSQ+ZRHGc Irllz/3ADdEqiAQrNe3OcXzurVC0OBd2gnH81F9lRZi3hRofnmcazjwQzvJYm4jUzmgq LdhS1JYpSa+mHTIgk94vLzpjDlwQFwGBRXsm4b9hfPzfelUVIykUMUB6JE9pB18DRQu+ P74ri3aoubK7McpI27Vni/08+52ImrkkWAEcDNRBVLMKHUqb7apR8F+12fn9lBSNEqyc sD4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729037953; x=1729642753; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=05Y/2FGPgyvbyYFbGsJUnsosQK0HSJiBFrb2Qq6aVrA=; b=mLHgJ9v0s850/OQl/wv4XvsUBB/QE3XO9cnReLGc3l5KISUlp1sjNF8KdVHvdLwYiU Af5M99k10D3aVLx0Pllr4KSpmNKkJb6seq6E5+uk+UzecDsfyJFCIz+6Ck0sVtXUzbrW WqJmp1FHXS6jSlF5V1pyYcvJSzo7vw5qIO30BejzRMNONgAp3VleEzYd+nWaGkVB8gar 8bz6Fg5z3WhqSJpSaByH/rXsZAPQFYITjg6e34MBizbySOUYzhgxtQ9XwxMP3i36iqkZ GM+3eZF32fO55mnqVVVl/FSwH1HENxUYg1NbRQGIUZzBV1K1OTQD0a5vSKEP9wxnIXFK GHMQ== X-Forwarded-Encrypted: i=1; AJvYcCUhnhEi90vyD1jAYjnQ33UKbH0iNxj15h3dLWpQtGkFwtO4oGbS8lqac6sNF643Is+o1s0cj89GewLURA==@lists.infradead.org X-Gm-Message-State: AOJu0YzKn8TgjSOxrcu+xvb73OAi8KmSS07RTjtZm+FC/xmrZZ+1/U4w klTDuSnS8ct+OzQk+cy7GEHap4xcxQL0FNrj0s3De5IeAvgEcPCB X-Google-Smtp-Source: AGHT+IE9HgCJhRnWQptiUjrKLZ5T1fYrbMbRfHuh8vb+zUtRxBOmbU+I5UJ/VxKiwNcLxD7n/D+MFA== X-Received: by 2002:a05:687c:2c0f:b0:25e:940:e934 with SMTP id 586e51a60fabf-288874e3a90mr6210798fac.47.1729037953127; Tue, 15 Oct 2024 17:19:13 -0700 (PDT) Received: from localhost.localdomain ([122.8.183.87]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-288daddf03csm621459fac.36.2024.10.15.17.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 17:19:11 -0700 (PDT) From: Chen Wang To: ukleinek@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, unicorn_wang@outlook.com, inochiama@outlook.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, linux-riscv@lists.infradead.org, chao.wei@sophgo.com, haijiao.liu@sophgo.com, xiaoguang.xing@sophgo.com, chunzhi.lin@sophgo.com Subject: [PATCH v4 0/3] pwm: Add pwm driver for Sophgo SG2042 Date: Wed, 16 Oct 2024 08:19:03 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241015_171915_098632_BBC92E9A X-CRM114-Status: GOOD ( 12.34 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Chen Wang Add driver for pwm controller of Sophgo SG2042 SoC. Thanks, Chen --- Changes in v4: The patch series is based on v6.12-rc1. Updated driver to set property atomic of pwm_chip to true as per suggestion from Sean. Changes in v3: The patch series is catched up with v6.12-rc1. You can simply review or test the patches at the link [3]. Add patch #3 for dts part change. Changes in v2: The patch series is based on v6.11-rc6. You can simply review or test the patches at the link [2]. Fixed following issues as per comments from Yixun Lan, Krzysztof Kozlowski and Uwe Kleine-König, thanks. - Some minor issues in dt-bindings. - driver issues, use macros with name prefix for registers access; add limitations comments; fixed potential calculation overflow problem; add .get_state() callback and other miscellaneous code improvements. Changes in v1: The patch series is based on v6.11-rc6. You can simply review or test the patches at the link [1]. Link: https://lore.kernel.org/linux-riscv/cover.1725536870.git.unicorn_wang@outlook.com/ [1] Link: https://lore.kernel.org/linux-riscv/cover.1725931796.git.unicorn_wang@outlook.com/ [2] Link: https://lore.kernel.org/linux-riscv/cover.1728355974.git.unicorn_wang@outlook.com/ [3] --- Chen Wang (3): dt-bindings: pwm: sophgo: add PWM controller for SG2042 pwm: sophgo: add driver for Sophgo SG2042 PWM riscv: sophgo: dts: add pwm controller for SG2042 SoC .../bindings/pwm/sophgo,sg2042-pwm.yaml | 51 +++++ arch/riscv/boot/dts/sophgo/sg2042.dtsi | 8 + drivers/pwm/Kconfig | 10 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-sophgo-sg2042.c | 181 ++++++++++++++++++ 5 files changed, 251 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/sophgo,sg2042-pwm.yaml create mode 100644 drivers/pwm/pwm-sophgo-sg2042.c base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc