From patchwork Fri May 2 19:15:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 4105031 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 224E39F467 for ; Fri, 2 May 2014 19:15:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 630B820373 for ; Fri, 2 May 2014 19:15:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9745E20374 for ; Fri, 2 May 2014 19:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752541AbaEBTPd (ORCPT ); Fri, 2 May 2014 15:15:33 -0400 Received: from sauhun.de ([89.238.76.85]:43121 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752197AbaEBTPc (ORCPT ); Fri, 2 May 2014 15:15:32 -0400 Received: from p4fe24f47.dip0.t-ipconnect.de ([79.226.79.71]:47461 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1WgIvj-0007Fu-9W; Fri, 02 May 2014 21:15:31 +0200 From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , linux-sh@vger.kernel.org, Magnus Damm , Geert Uytterhoeven , Wolfram Sang Subject: [PATCH v2 03/10] i2c: sh_mobile: honor DT bus speed settings Date: Fri, 2 May 2014 21:15:09 +0200 Message-Id: <1399058116-7721-4-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1399058116-7721-1-git-send-email-wsa@the-dreams.de> References: <1399058116-7721-1-git-send-email-wsa@the-dreams.de> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wolfram Sang Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-sh_mobile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index d2fa222df3d1..2e481abd50ce 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c @@ -657,6 +657,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) struct resource *res; int size; int ret; + u32 bus_speed; pd = kzalloc(sizeof(struct sh_mobile_i2c_data), GFP_KERNEL); if (pd == NULL) { @@ -697,7 +698,9 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) } /* Use platform data bus speed or STANDARD_MODE */ - pd->bus_speed = STANDARD_MODE; + ret = of_property_read_u32(dev->dev.of_node, "clock-frequency", &bus_speed); + pd->bus_speed = ret ? STANDARD_MODE : bus_speed; + if (pdata && pdata->bus_speed) pd->bus_speed = pdata->bus_speed; pd->clks_per_count = 1;