From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Hutchings Subject: Re: [PATCH v3 5/6] ARM: shmobile: lager: Set clock rates for SDHI Date: Tue, 30 Jun 2015 02:29:53 +0100 Message-ID: <1435627793.23818.45.camel@codethink.co.uk> References: <1435332116.23818.7.camel@codethink.co.uk> <1435332230.23818.12.camel@codethink.co.uk> <87a8vjjas8.wl%kuninori.morimoto.gx@renesas.com> <1435622561.23818.43.camel@codethink.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:36984 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080AbbF3B36 (ORCPT ); Mon, 29 Jun 2015 21:29:58 -0400 In-Reply-To: <1435622561.23818.43.camel@codethink.co.uk> Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Kuninori Morimoto Cc: Simon , Sergei Shtylyov , Linux-SH , Laurent , Ian Molton , Geert Uytterhoeven , linux-kernel@lists.codethink.co.uk, linux-gpio@vger.kernel.org, linux-mmc@vger.kernel.org On Tue, 2015-06-30 at 01:02 +0100, Ben Hutchings wrote: > On Mon, 2015-06-29 at 06:23 +0000, Kuninori Morimoto wrote: [...] > > If so, why we can't use max-frequency ? > > We can calculate/set SDHI IP clocks via > > max-frequency / clk_round_rate() / clk_set_rate() > > since we know SDHI's divider capability. > > > > SH-MMC is using this style. and I think it is flexible for every speed. > > Please check sh_mmcif_clock_control(), sh_mmcif_clk_setup() > > on ${LINUX}/drivers/mmc/host/sh_mmcif.c > > That's certainly a nicer way of doing this. The difficulty I see is > that tmio_mmc doesn't know anything about the input clock, and not all > of the drivers using it actually use the clock framework. More importantly, that algrithm can result in overclocking the card. Ben.