Received: by 10.223.185.116 with SMTP id b49csp1840271wrg; Thu, 22 Feb 2018 04:07:23 -0800 (PST) X-Google-Smtp-Source: AH8x226xHVFRWNSZ2DWr8zYedRrXogEDvGBtP4W+nKhHh8pbOKOjtKvNeowMpiQ7vETV+4b7pMdb X-Received: by 2002:a17:902:724b:: with SMTP id c11-v6mr6399168pll.352.1519301242861; Thu, 22 Feb 2018 04:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519301242; cv=none; d=google.com; s=arc-20160816; b=fe5cmcJUABLm+mf/Oh+7k2zAvNkJONdTMdwkEAOPOVgCNFosYIvxglHhLdnoRulLHa KbMDe3h6awX/bR4lAXowgZIgJ12ak+Lbvqn6dTVOjYB5DTpRc9axVGNXvpRk0ibCtOna Uu1s08fGeMxg8VjGguoyKrpqZrdsXkDNsv90Wpci8XHOb8Zp8Db7B45/Mh7atTt9MX49 VHf1tKm36e6is2h8OqcZUvH4hTrzhJINaC3tr+9EeqRxXhKpmE4v4B3bls1bTA3Kkitx Lz3HzXD3nHPUvQlOIBdXTbZ703fbgWAjgyiVO87pJjXkIxZN2UXjSuBW00FOBtNgrzCV wDCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=/BY3ys4uJp4u2z6ExviwhqMXGwfGIF3eW5fMdvO3Z9M=; b=xBvutaGilsiKxJqZqlNyBNPjoeHSZgtrYy+bpIVWUQ5TpOKk2LpRN49Pv+bpheBuET lx7WSzQ7lBu/7S9wlmQn2prB2VTxDOGLgHI+KZ/TkdhH0o9f7Ztu9R3IzqEIPbf72UvV 7+utwaC92znih41XQW8PbYnl1FzLrotqRVvgOM5+QlwQWk+QGqjWNusQJF3qGSW6+f2V s6oQ5ZZh3gGBuHb54x/m5x4S5kaRB10qQDv191ERR/5M7Zm9omaRVWfUFqCZmfrx5znK VdzcH4tNuHNt9CMrNZE09SYY/EaIn8oi2YVXXXbMwElxq1mQU66vGdImLFfuav6iEmbt teww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g34-v6si1592459pld.513.2018.02.22.04.07.04; Thu, 22 Feb 2018 04:07:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932397AbeBVMEB (ORCPT + 99 others); Thu, 22 Feb 2018 07:04:01 -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 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"; -- 2.7.4