Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751792AbbEZUFT (ORCPT ); Tue, 26 May 2015 16:05:19 -0400 Received: from mail-gw1-out.broadcom.com ([216.31.210.62]:52021 "EHLO mail-gw1-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbbEZUFR (ORCPT ); Tue, 26 May 2015 16:05:17 -0400 X-IronPort-AV: E=Sophos;i="5.13,501,1427785200"; d="scan'208";a="66011533" From: Jonathan Richardson To: Tim Kryger , Dmitry Torokhov , Anatol Pomazau , Arun Ramamurthy , Thierry Reding CC: Scott Branden , Jonathan Richardson , bcm-kernel-feedback-list , , , Arun Ramamurthy Subject: [PATCH v8 2/5] drivers: pwm: bcm-kona: Dont set polarity in probe Date: Tue, 26 May 2015 13:08:17 -0700 Message-ID: <1432670900-27687-3-git-send-email-jonathar@broadcom.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1432670900-27687-1-git-send-email-jonathar@broadcom.com> References: <1432670900-27687-1-git-send-email-jonathar@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1748 Lines: 50 From: Arun Ramamurthy Omit setting the polarity to normal during probe and instead use the new pwmchip_add_inversed function to register a PWM chip with default polarity of inversed for all channels as this is the actual hardware default. Signed-off-by: Arun Ramamurthy Reviewed-by: Ray Jui Signed-off-by: Scott Branden Signed-off-by: Tim Kryger Signed-off-by: Jonathan Richardson --- drivers/pwm/pwm-bcm-kona.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/pwm/pwm-bcm-kona.c b/drivers/pwm/pwm-bcm-kona.c index 02bc048..32b3ec6 100644 --- a/drivers/pwm/pwm-bcm-kona.c +++ b/drivers/pwm/pwm-bcm-kona.c @@ -266,18 +266,15 @@ static int kona_pwmc_probe(struct platform_device *pdev) return ret; } - /* Set smooth mode, push/pull, and normal polarity for all channels */ - for (chan = 0; chan < kp->chip.npwm; chan++) { - value |= (1 << PWM_CONTROL_SMOOTH_SHIFT(chan)); + /* Set push/pull for all channels */ + for (chan = 0; chan < kp->chip.npwm; chan++) value |= (1 << PWM_CONTROL_TYPE_SHIFT(chan)); - value |= (1 << PWM_CONTROL_POLARITY_SHIFT(chan)); - } writel(value, kp->base + PWM_CONTROL_OFFSET); clk_disable_unprepare(kp->clk); - ret = pwmchip_add(&kp->chip); + ret = pwmchip_add_inversed(&kp->chip); if (ret < 0) dev_err(&pdev->dev, "failed to add PWM chip: %d\n", ret); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/