From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57A38C4338F for ; Mon, 26 Jul 2021 04:33:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D42460BD3 for ; Mon, 26 Jul 2021 04:33:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0D42460BD3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=tkos.co.il Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date: In-reply-to:Subject:Cc:To:From:References:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=zlajTAoF/k5pOYoHqh3nmQb7Bkh9ubhMFx4NU9vP9A8=; b=4wqaxbGDpXz5weAX3sNUIf33z5 bw0EWlSXr9T9rWPscUuz6yuNcz0MOCmKh3Y0UR/s0jm1iiiDbKVtHBkd4Gdx2FSSZ9bJeZJ7yFHc1 JvWem4TSnkUr9SezwKKGVJop8Az6Bl2qwoHLdXf6670kZz4L4d8ZpUCmX9ghiidpZT5WX172xyhrF mqgPhf6XKHFxtqLMcDe4dxuatSauIxBojPSkVsZcJJZJ+li0fQB91lnexgOgnK0+kiUCLtSfFbW1G r/L+9K0JKAB5XvWIomMTbyDpP9CY6zc3q+KexbVjZ0d/9HMcy5ukoq6RRBhUpoQSM6OdsAUZhvXI5 TSz5wGHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7sHb-009ZPd-Lc; Mon, 26 Jul 2021 04:32:03 +0000 Received: from guitar.tcltek.co.il ([192.115.133.116] helo=mx.tkos.co.il) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7sHX-009ZOi-MY for linux-arm-kernel@lists.infradead.org; Mon, 26 Jul 2021 04:32:01 +0000 Received: from tarshish (unknown [10.0.8.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPS id 7EC644400D8; Mon, 26 Jul 2021 07:31:43 +0300 (IDT) References: <889aae1b88f120cb6281919d27164a959fbe69d0.1626948070.git.baruch@tkos.co.il> <2c4df635c57085fc33150d1b9a97845694e63e03.1626948070.git.baruch@tkos.co.il> User-agent: mu4e 1.4.15; emacs 27.1 From: Baruch Siach To: Bjorn Andersson Cc: Thierry Reding , Uwe Kleine-K?nig , Lee Jones , Andy Gross , Balaji Prakash J , Rob Herring , Robert Marko , Kathiravan T , linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v6 2/4] pwm: driver for qualcomm ipq6018 pwm block In-reply-to: Date: Mon, 26 Jul 2021 07:31:55 +0300 Message-ID: <87czr5wv9g.fsf@tarshish> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210725_213200_009504_1DA09ECC X-CRM114-Status: GOOD ( 12.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Bjorn, On Sun, Jul 25 2021, Bjorn Andersson wrote: > On Thu 22 Jul 05:01 CDT 2021, Baruch Siach wrote: >> + if (IS_ERR(pwm->clk)) >> + return dev_err_probe(dev, PTR_ERR(pwm->clk), >> + "failed to get core clock"); >> + >> + ret = clk_prepare_enable(pwm->clk); > > Not sure if Uwe asked you this already, but do you need to clock the > supply even when the PWM isn't enabled? I guess not. However, tracking clock enable/disable per PWM signal complicates the code. We'd need to balance enables with matching disables in the .remove callback. I'd prefer to leave that as room for future optimization. >> + if (ret) >> + return dev_err_probe(dev, ret, "clock enable failed"); >> + >> + pwm->chip.dev = dev; >> + pwm->chip.ops = &ipq_pwm_ops; >> + pwm->chip.npwm = 4; >> + >> + ret = pwmchip_add(&pwm->chip); > > Depending on above answer you may or may not have the need to ensure the > ordering of clk_disable_unprepare() in the remove function. According to Uwe pwmchip_remove() must precede clock disable: https://lore.kernel.org/linux-arm-msm/20210714201839.kfyqcyvowekc4ejs@pengutronix.de/ How is that related to per PWM signal clock handling? > Otherwise devm_pwmchip_add() would be nice here. Thanks, baruch -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il - _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel