From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751129AbdEaP6q (ORCPT ); Wed, 31 May 2017 11:58:46 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:49867 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbdEaP6o (ORCPT ); Wed, 31 May 2017 11:58:44 -0400 Subject: Re: CLK_OF_DECLARE advice required To: Stephen Warren , Phil Elwell Cc: Michael Turquette , Stephen Boyd , "linux-kernel@vger.kernel.org" , linux-rpi-kernel , linux-clk@vger.kernel.org References: <8b65e551-e6dd-cf5c-1b22-e1f1a5996d73@wwwdotorg.org> From: Stefan Wahren Message-ID: <0794f430-9761-c855-9a89-13d9871c5831@i2se.com> Date: Wed, 31 May 2017 17:58:08 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <8b65e551-e6dd-cf5c-1b22-e1f1a5996d73@wwwdotorg.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: de-DE X-Provags-ID: V03:K0:Z4B5Rkh1sAy3xAT1GF5u8Ohs5d0kDGf1AcQI5/UKAWmePGu+15f AtKRiPT4iLbEoZnG3w7S8/V14zndw3pc+7bVEyVQPJ7kFtT5KdxsNjeX7/exg1r/Dxf0c51 0Zfs/6JYGSfpMVtFRzcu5Pv6n1WJt0cEGw7RsVr3riqHmZfYGYOso4e/EfXFhkGEauzGUjw MU7K+EeUC+ajPC/n1KD4w== X-UI-Out-Filterresults: notjunk:1;V01:K0:YO7rRUbk+FI=:RmWgliFH4H0WsGYy5oJlrb GTt+E56AmD2XJWTBc0kuGonbh5/jzWVOaKngaLUJ/qzlhtpudIiGJE7im94zqHiq1DhuOcFMX bsgV/PU5NIZib+dv/T3CMpdrgFud0m6StTaufg9rtqD7Djjh7YFMXQOD0WPwqnGLCCJkQwXd1 roz+/Y1x4cq5BMQ/sBboDcAGxecyMJ35kNvssTrOWF6qoZUS1qXRw12odV+ZHjR8AJ52tdxMt i9QF0VossdbZ4Rgc7OHP5K2CLbSDFmHM6cLGhpC65MbfMyUBvTd+in8NkoU9jkEFbjvbFsKb2 Vu+AgUzLkQeIzjSeCDD/vnUmIeCTXRwSHfPi9SzvLbytRp8jSchnc3xIDLNnGe53kqQRZ2PXS MuNpafmWVE49uLaKko46fVHfcWyjXjbQlj62t2iaLVTOgqNSv6JCn6HsNHJ8tpXF14KfJ7QQa WZMZsXYi78p9kIwqHWxuuBFtZiVD6Y59fIdAXIg2k+hepxNS8lWnUU+7Dg1052CnbQe4C2yl4 i6rcSynM7HQjVJv1jcWOggrzNd1Earw1seklXzU/feKYP5iWXtRAEfBwpynm5DL9Xfm/x0GgZ sIzqX5lB/KSojgnpe3ZCj2h6m43CcGAcDyiV4bVPPBwfWzE5yygeub70U5bwRepXSKddrTHzT Y4tfVevBpZ7IcqbGave7/ful9fOxmK8Tc730K+ZX7W3rLXV0kKuYXkwAXX0Yp1XwLDuGHL2cZ K7LcjMgi7aVlXGgy Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 31.05.2017 um 17:27 schrieb Stephen Warren: > On 05/30/2017 06:23 AM, Phil Elwell wrote: >> Hi, >> >> I've run into a problem using the fixed-factor clock on Raspberry Pi >> and I'd >> like some advice before I submit a patch. >> >> Some context: the aim is to use a standard UART and some external >> circuitry >> as a MIDI interface. This would be straightforward except that Linux >> doesn't >> recognise the required 31.25KHz as a valid UART baud rate. Rhe >> workaround is >> to declare the UART clock such that the reported rate differs from >> the actual >> rate. If one sets the reported rate to be (actual*38400)/31250 then >> requesting a 38400 baud rate will result in an actual 31250 baud signal. > > This sounds like the wrong approach. Forcing the port to use a > different clock rate than the user requests would prevent anyone from > using that port for its standard purpose; it'd turn what should be a > runtime decision into a compile-time decision. > > Are you sure there's no way to simply select the correct baud rate on > the port? I see plenty of references to configuring custom baud rates > under Linux when I search Google, e.g.: > >> https://stackoverflow.com/questions/12646324/how-to-set-a-custom-baud-rate-on-linux >> > "How to set a custom baud rate on Linux?" > >> https://sourceware.org/ml/libc-help/2009-06/msg00016.html > "Re: Terminal interface and non-standard baudrates" > I remember this gist from Peter Hurley: https://gist.github.com/peterhurley/fbace59b55d87306a5b8