From patchwork Sat Dec 6 23:13:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Kryger X-Patchwork-Id: 418429 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 18CDD1400E7 for ; Sun, 7 Dec 2014 10:13:23 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751734AbaLFXNV (ORCPT ); Sat, 6 Dec 2014 18:13:21 -0500 Received: from mail-oi0-f41.google.com ([209.85.218.41]:38409 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203AbaLFXNU (ORCPT ); Sat, 6 Dec 2014 18:13:20 -0500 Received: by mail-oi0-f41.google.com with SMTP id a3so1991667oib.28 for ; Sat, 06 Dec 2014 15:13:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Qvgvt5n7jbKuVjbaXd2KaqNAkNAp6ySdD+ZFNIFuC6E=; b=gJ9CeQhs5B4fsEjp5oevy7CHz2cUDr0WsPJZ3H9bTC4VE5g4emNIoOL2iof2csVpZr BLbVraxpThAI81krvteskWzvypcE74Ltwtfx4KZqpYUNtWep/7s5XEfZmmrP4aotcdhJ qzWzxwZ3ghpS8QPGlzgRPDPPoRJQYHQfl8l1RegUGm4i6Gkcz50u9+UkgVi4YHO2EvHj WwYbmWm/wbmMBrI6HDUfkXPV9vL5Go/Am2W7KVKa9EwQusw0YrvxGvOPlBK0IJVxNfxi 8pq8i7WNz9habGiGwECOCt0eBBRogngrSnkB1zLkOgtsvw6uZEqzxIaaqaHD4b8zP5/W CPbg== MIME-Version: 1.0 X-Received: by 10.183.24.129 with SMTP id ii1mr14967201obd.34.1417907599976; Sat, 06 Dec 2014 15:13:19 -0800 (PST) Received: by 10.60.135.69 with HTTP; Sat, 6 Dec 2014 15:13:19 -0800 (PST) In-Reply-To: <5480C286.6000405@broadcom.com> References: <1416944441-12066-1-git-send-email-sbranden@broadcom.com> <1416944441-12066-2-git-send-email-sbranden@broadcom.com> <5479097B.6020108@broadcom.com> <54791F30.3050306@broadcom.com> <5480C286.6000405@broadcom.com> Date: Sat, 6 Dec 2014 15:13:19 -0800 Message-ID: Subject: Re: [PATCH v2 1/4] pwm: kona: Remove setting default smooth type and polarity for all channels From: Tim Kryger To: Jonathan Richardson Cc: Arun Ramamurthy , Scott Branden , Thierry Reding , Ray Jui , Arun Ramamurthy , bcm-kernel-feedback-list@broadcom.com, linux-pwm@vger.kernel.org, Linux Kernel Mailing List Sender: linux-pwm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org On Thu, Dec 4, 2014 at 12:22 PM, Jonathan Richardson wrote: > Hi Tim, > > I'm going to take over this submission because I made the changes to the > driver. Arun was filling in for me while I was on leave. Now I'm back > and I think I can help clarify why these changes were made. A summary > for all the changes should help. > > There were two problems. First was a problem caused by setting the > polarity in probe. It caused the speaker to click when the polarity was > set so we took that out as it didn't seem to serve any useful purpose > that I could see. The polarity changes should be made in the polarity > callback. Please provide more details about your configuration. Are you using the pwm-beeper driver with a piezo? After a reset, all PWM output will be low until the PWM clock is enabled at which point it will be constant high. Are you confident that this transition is not responsible for the click you are hearing? > The second and bigger problem was the smooth type sequence. If it isn't > done according to the spec then one in ten or twenty times you won't > even get a signal when it's enabled. Following the correct sequence with > the 400 ns delays solves this problem. Would the following minor change be sufficient to fix the issue? > > Additionally, by not following the sequence you won't get a smooth > transition. You'll get a change in the settings (duty cycle, period) but > may get a non smooth transition. So it's important to follow the spec > here. We don't want non-smooth transitions. Please provide your rationale for requiring smooth transitions. Thanks, Tim Kryger --- To unsubscribe from this list: send the line "unsubscribe linux-pwm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pwm/pwm-bcm-kona.c b/drivers/pwm/pwm-bcm-kona.c index 02bc048..c537efd 100644 --- a/drivers/pwm/pwm-bcm-kona.c +++ b/drivers/pwm/pwm-bcm-kona.c @@ -85,6 +85,9 @@ static void kona_pwmc_apply_settings(struct kona_pwmc *kp, uns value &= ~(1 << PWM_CONTROL_TRIGGER_SHIFT(chan)); writel(value, kp->base + PWM_CONTROL_OFFSET); + ndelay(400); + /* Set trigger bit and clear smooth bit to apply new settings */ value &= ~(1 << PWM_CONTROL_SMOOTH_SHIFT(chan)); value |= 1 << PWM_CONTROL_TRIGGER_SHIFT(chan);