From patchwork Mon Mar 26 11:19:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10307639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BF96E60386 for ; Mon, 26 Mar 2018 11:20:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A949C29654 for ; Mon, 26 Mar 2018 11:20:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AE8929653; Mon, 26 Mar 2018 11:20:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 61CCC2961B for ; Mon, 26 Mar 2018 11:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=23YBFOQ9c835EaAK2rpBQvcPQ6hrk2QDFieOZnQZA7o=; b=Jy1IJNQnKZVqPY aqhMhXfdSQBSi6j2rCUr1Y3EUU5/dIDMm80s0xNf6qV6UWEFqu603YGgMKJqtgKhsEZkyQm2XPg9W 9LAGVkmVqm9DGhuNs6ChKoMF9W526tqnsjVayASGstecng8z6RLC8A9Jxuz6XpbsxoVmaWGczNTef dVbZoDWB8K4YxNPFSe7Cx5OYnanegO5DcCtBtKIWiPwBA3JdmCxO37LOyq23GsG87boHfaSJ3dFoJ f235Yyhdtjvh67l1dR3zFL2GvY0kc8cTKlAjgTSTcXE+HgWXPFXuT2zCcu8YelESi3fqU+rRPz6o8 4sM28lCHEgGRkxwdNvkg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0QAg-0006gT-DN; Mon, 26 Mar 2018 11:20:14 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0QAI-00057s-FC for linux-arm-kernel@lists.infradead.org; Mon, 26 Mar 2018 11:19:52 +0000 X-IronPort-AV: E=Sophos;i="5.48,364,1517900400"; d="scan'208";a="10527468" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 26 Mar 2018 04:19:39 -0700 Received: from localhost.localdomain.com (10.10.76.4) by chn-sv-exch07.mchp-main.com (10.10.76.108) with Microsoft SMTP Server id 14.3.352.0; Mon, 26 Mar 2018 04:19:38 -0700 From: Tudor Ambarus To: , , , , , Subject: [RFC PATCH 2/2] i2c: at91: provide bus_freq_hz Date: Mon, 26 Mar 2018 14:19:27 +0300 Message-ID: <20180326111927.16040-2-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20180326111927.16040-1-tudor.ambarus@microchip.com> References: <20180326111927.16040-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180326_041950_509190_6E6C3CA9 X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tudor Ambarus Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The clock-frequency property is not mandatory for the i2c buses. If it's not present in device tree, the buses usually assume that is 100kHZ. There are i2c clients that need to know the clock frequency in order to compute their wake token. Spare the clients of making (wrong) assumptions and provide the bus frequency in adapter. Signed-off-by: Tudor Ambarus Acked-by: Ludovic Desroches --- drivers/i2c/busses/i2c-at91.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c index bfd1fdf..d3cd84e 100644 --- a/drivers/i2c/busses/i2c-at91.c +++ b/drivers/i2c/busses/i2c-at91.c @@ -1116,6 +1116,7 @@ static int at91_twi_probe(struct platform_device *pdev) dev->adapter.quirks = &at91_twi_quirks; dev->adapter.dev.parent = dev->dev; dev->adapter.nr = pdev->id; + dev->adapter.bus_freq_hz = bus_clk_rate; dev->adapter.timeout = AT91_I2C_TIMEOUT; dev->adapter.dev.of_node = pdev->dev.of_node;