From patchwork Thu Feb 22 12:01:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 10235313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D6C160224 for ; Thu, 22 Feb 2018 12:04:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1792328BE6 for ; Thu, 22 Feb 2018 12:04:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0971728BEA; Thu, 22 Feb 2018 12:04:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 758F528BE6 for ; Thu, 22 Feb 2018 12:04:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932407AbeBVMEC (ORCPT ); Thu, 22 Feb 2018 07:04:02 -0500 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:62237 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932103AbeBVMDy (ORCPT ); Thu, 22 Feb 2018 07:03:54 -0500 X-IronPort-AV: E=Sophos;i="5.47,377,1515481200"; d="scan'208";a="12245995" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Feb 2018 05:03:51 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.76.4) by chn-sv-exch05.mchp-main.com (10.10.76.106) with Microsoft SMTP Server id 14.3.352.0; Thu, 22 Feb 2018 05:03:51 -0700 From: Claudiu Beznea To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , , , , , , , , , Claudiu Beznea Subject: [PATCH v3 08/10] pwm: add push-pull mode support Date: Thu, 22 Feb 2018 14:01:19 +0200 Message-ID: <1519300881-8136-9-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519300881-8136-1-git-send-email-claudiu.beznea@microchip.com> References: <1519300881-8136-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add push-pull mode support. In push-pull mode the channels' outputs have same polarities and the edges are complementary delayed for one period. Signed-off-by: Claudiu Beznea --- include/linux/pwm.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/pwm.h b/include/linux/pwm.h index 0ba416ab2772..765d760ef82d 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h @@ -29,11 +29,14 @@ enum pwm_polarity { * PWM modes * @PWM_MODE_NORMAL_BIT: PWM has one output * @PWM_MODE_COMPLEMENTARY_BIT: PWM has 2 outputs with opposite polarities + * @PWM_MODE_PUSH_PULL_BIT: PWM has 2 outputs with same polarities and the edges + * are complementary delayed for one period * @PWM_MODE_CNT: PWM modes count */ enum { PWM_MODE_NORMAL_BIT, PWM_MODE_COMPLEMENTARY_BIT, + PWM_MODE_PUSH_PULL_BIT, PWM_MODE_CNT, }; @@ -481,7 +484,11 @@ static inline bool pwm_caps_valid(struct pwm_caps caps) static inline const char * const pwm_mode_desc(unsigned long mode) { - static const char * const modes[] = { "normal", "complementary" }; + static const char * const modes[] = { + "normal", + "complementary", + "push-pull", + }; if (!pwm_mode_valid(mode)) return "invalid";