From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from azure-sdnproxy.icoremail.net (azure-sdnproxy.icoremail.net [207.46.229.174]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 403612BD587; Fri, 6 Mar 2026 09:30:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=207.46.229.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772789452; cv=none; b=R8WvG/K1BjFTdoXt0ujTEIybx44M7cvdNq4hENtKlUn8gmgy0d6Re4pUU8w8apIDZlOuqJoxh9hCuQvdxRhDLJiMbBZMwJ/kbIvGMRqOl59ykSVnroZ6UGQ40ohHBf1ZY7+IBJJLB+LTu4jRtf/XuoBrLPnpd7HryaTPwbr+KSA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772789452; c=relaxed/simple; bh=G87MZlRCEh3ibHw01hOa/FGyjGQvzv88dSRlrph6e8g=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=hDIfUjdiI7/v0S8zmA2b2PTzR1kioOuXH5SAYnCcaD545MK7RmZjmHSIyOc/jLCOqyl2zgySUpQNhKi0Kw0qEsdc8b1d0XNFqIF0+MVBV1aq0KB7YczaThQjxrSI8jj4dnZyb1ldeoNEHmBSLnPuZr4zCoLX5f7obWLxNHowBEw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=eswincomputing.com; spf=pass smtp.mailfrom=eswincomputing.com; arc=none smtp.client-ip=207.46.229.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=eswincomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=eswincomputing.com Received: from E0005152DT.eswin.cn (unknown [10.12.96.41]) by app1 (Coremail) with SMTP id TAJkCgDXbHGtnqppxC0GAA--.25521S2; Fri, 06 Mar 2026 17:30:22 +0800 (CST) From: dongxuyang@eswincomputing.com To: ukleinek@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, ben-linux@fluff.org, ben.dooks@codethink.co.uk, p.zabel@pengutronix.de, linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ningyu@eswincomputing.com, linmin@eswincomputing.com, xuxiang@eswincomputing.com, wangguosheng@eswincomputing.com, pinkesh.vaghela@einfochips.com, Xuyang Dong Subject: [PATCH v2 0/2] Update designware pwm driver Date: Fri, 6 Mar 2026 17:30:00 +0800 Message-Id: <20260306093000.2065-1-dongxuyang@eswincomputing.com> X-Mailer: git-send-email 2.31.1.windows.1 Precedence: bulk X-Mailing-List: linux-pwm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:TAJkCgDXbHGtnqppxC0GAA--.25521S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Ww43uF1DKFW5KF1UWr4rZrb_yoW8KF48pa 1kGrWakr95WryIgr93W3W8CFy5t3WxJrW7Kw4fJw1UZan0vrWUZ3yvgFy5tF9F93WFgry2 kryfWw42ka45ArJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBv14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2 Y2ka0xkIwI1lw4CEc2x0rVAKj4xxMxkF7I0En4kS14v26r1q6r43MxkIecxEwVCm-wCF04 k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18 MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr4 1lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1l IxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4 A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUmjgxUUUUU= X-CM-SenderInfo: pgrqw5xx1d0w46hv4xpqfrz1xxwl0woofrz/ From: Xuyang Dong There is already a patch [1] for the DesignWare PWM driver, which is posted by Ben and still under review. Based on this patch, this series is a continuation of [1] to add support for IP versions 2.11a and later, which includes support for "Pulse Width Modulation with 0% and 100% Duty Cycle". Supported chips: ESWIN EIC7700 series SoC. Test: Tested this patch on the Sifive HiFive Premier P550 (which uses the EIC7700 SoC). [1] https://lore.kernel.org/lkml/20230907161242.67190-1-ben.dooks@codethink.co.uk/ Updates: Change in v2: - YAML: - Remove eswin,eic7700-pwm.yaml. Use snps,dw-apb-timers-pwm2.yaml. The description in snps,dw-apb-timers-pwm2.yaml is better. - Add the resets property as optional, as defined in the databook. - Remove snps,pwm-full-range-enable as no additional property is needed. - Driver: - Change the file from pwm-dwc-eic7700.c to pwm-dwc-of.c from [1]. - Define DWC_TIM_VERSION_ID_2_11A 2.11a as the baseline version. - Enable the 0% and 100% duty cycle mode by setting dwc->feature if the version read from the TIMERS_COMP_VERSION register is later than or equal to DWC_TIM_VERSION_ID_2_11A. - Use the DIV_ROUND_UP_ULL() to calculate width in the .apply and .get_state. - Additionally, Power Management (PM) support has been added to the pwm-dwc-of.c driver. - Drop the headers that are not used. - Use devm_clk_get_enabled() instead of devm_clk_get(). - Drop of_match_ptr. - Fix build error with 1ULL << 32. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202512061720.j31AsgM7-lkp@intel.com/ - Link to v1: https://lore.kernel.org/all/20251205090411.1388-1-dongxuyang@eswincomputing.com/ - Link to v9: https://lore.kernel.org/lkml/20230907161242.67190-1-ben.dooks@codethink.co.uk/ Xuyang Dong (2): dt-bindings: pwm: dwc: add reset optional pwm: dwc: add of/platform support .../bindings/pwm/snps,dw-apb-timers-pwm2.yaml | 3 + drivers/pwm/Kconfig | 10 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-dwc-core.c | 101 ++++++-- drivers/pwm/pwm-dwc-of.c | 216 ++++++++++++++++++ drivers/pwm/pwm-dwc.h | 25 +- 6 files changed, 327 insertions(+), 29 deletions(-) create mode 100644 drivers/pwm/pwm-dwc-of.c -- 2.34.1