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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 06591C8300A for ; Thu, 30 Apr 2020 10:20:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D778B20787 for ; Thu, 30 Apr 2020 10:20:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726789AbgD3KUf (ORCPT ); Thu, 30 Apr 2020 06:20:35 -0400 Received: from retiisi.org.uk ([95.216.213.190]:57268 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725280AbgD3KU0 (ORCPT ); Thu, 30 Apr 2020 06:20:26 -0400 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id 8AD6A634C8F; Thu, 30 Apr 2020 13:20:18 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1jU6Ik-0000QX-ER; Thu, 30 Apr 2020 13:20:18 +0300 Date: Thu, 30 Apr 2020 13:20:18 +0300 From: Sakari Ailus To: Marco Felsch Cc: Robert Foss , Andy Shevchenko , Maxime Ripard , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dongchun Zhu , Fabio Estevam , Tomasz Figa Subject: Re: [PATCH v6 2/3] media: ov8856: Add devicetree support Message-ID: <20200430102018.GI867@valkosipuli.retiisi.org.uk> References: <20200429162437.2025699-1-robert.foss@linaro.org> <20200429162437.2025699-3-robert.foss@linaro.org> <20200430093524.GB2188@pengutronix.de> <20200430094549.GF867@valkosipuli.retiisi.org.uk> <20200430095332.GC2188@pengutronix.de> <20200430095907.GG867@valkosipuli.retiisi.org.uk> <20200430101157.GD2188@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200430101157.GD2188@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 30, 2020 at 12:11:57PM +0200, Marco Felsch wrote: > On 20-04-30 12:59, Sakari Ailus wrote: > > Hi Marco, > > > > On Thu, Apr 30, 2020 at 11:53:32AM +0200, Marco Felsch wrote: > > > Hi Sakari, > > > > > > On 20-04-30 12:45, Sakari Ailus wrote: > > > > Hi Marco, > > > > > > > > On Thu, Apr 30, 2020 at 11:35:24AM +0200, Marco Felsch wrote: > > ... > > > > > > > - if (mclk != OV8856_MCLK) { > > > > > > - dev_err(dev, "external clock %d is not supported", mclk); > > > > > > - return -EINVAL; > > > > > > + if (!is_acpi_node(fwnode)) { > > > > > > + ov8856->xvclk = devm_clk_get(dev, "xvclk"); > > > > > > + if (IS_ERR(ov8856->xvclk)) { > > > > > > + dev_err(dev, "could not get xvclk clock (%pe)\n", > > > > > > + ov8856->xvclk); > > > > > > + return PTR_ERR(ov8856->xvclk); > > > > > > + } > > > > > > + > > > > > > + clk_set_rate(ov8856->xvclk, xvclk_rate); > > > > > > + xvclk_rate = clk_get_rate(ov8856->xvclk); > > > > > > } > > > > > > > > > > Why do we handle the clock only in DT case? Is there a problem with the > > > > > clock handling and ACPI? > > > > > > > > Not really, it's just that ACPI does not provide an interface to the clocks > > > > as such. > > > > > > But you will get a clk by devm_clk_get()? > > > > No, because ACPI does not expose one to drivers. Effectively the entire > > power sequences are implemented in ACPI, not in the driver. > > > > Ah okay, thanks for the explanation. I'm really not into the ACPI > stuff.. So this means the __power_off / power_on should only be done if > we are using DT's? Correct. That's why it bails out early. It could be yet earlier though, without doing anything. -- Sakari Ailus