Message ID | 20180801133512.12276-2-tudor.ambarus@microchip.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33CAD15E2 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 1 Aug 2018 13:35:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 232262A659 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 1 Aug 2018 13:35:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 173982ABF3; Wed, 1 Aug 2018 13:35:50 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 A4CC22AB43 for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 1 Aug 2018 13:35:49 +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=WZhLRdiyPUxZkOffRtasutkj2zgD8Hajr29ouSHU6zk=; b=LDjc+xzIDXe799 lLqNj9L1VwvXDEvwv8kc+O4UammTtZvZbVdQGaBHmvM2D7nC+SvYIuBY6n+zCaTZ0chzpTf1iBc+D QBbOqnWR5c4rF6pbtk+Wk6RcGaYUbr/XJJ7cgS9HuUshQxymUwOKnt6q2sekA55InXLDCFq5rqA2R hRGBwJhS7Rs9XSVH7h+4Xo3G3Mwl64DPdjrfUpd1bIBCsZcuTPJfQEmPeEmzS59Z9YUIGOrh6AytY wKaWtuSMh4UDeQtUV2uXWGSZ8CYCLuYSFBWtIcE4CEUSO+GLjO7sbLeOXnxQgif+5VC18Z3RNv8sD GWbIbMUy4zQ2y2MyDdfg==; 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 1fkrI3-0006QC-6t; Wed, 01 Aug 2018 13:35:47 +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 1fkrI0-0006NV-4h for linux-arm-kernel@lists.infradead.org; Wed, 01 Aug 2018 13:35:45 +0000 X-IronPort-AV: E=Sophos;i="5.51,432,1526367600"; d="scan'208";a="15042264" 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; 01 Aug 2018 06:35:35 -0700 Received: from localhost.localdomain.com (10.10.76.4) by chn-sv-exch02.mchp-main.com (10.10.76.38) with Microsoft SMTP Server id 14.3.352.0; Wed, 1 Aug 2018 06:35:33 -0700 From: Tudor Ambarus <tudor.ambarus@microchip.com> To: <wsa@the-dreams.de>, <linux-i2c@vger.kernel.org>, <ludovic.desroches@microchip.com>, <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com> Subject: [PATCH 1/2] i2c: enable buses to save their clock frequency in adapter Date: Wed, 1 Aug 2018 16:35:11 +0300 Message-ID: <20180801133512.12276-2-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20180801133512.12276-1-tudor.ambarus@microchip.com> References: <20180801133512.12276-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-20180801_063544_287946_DF6EE94D X-CRM114-Status: GOOD ( 10.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tudor Ambarus <tudor.ambarus@microchip.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
i2c: enable buses to save their clock frequency in adapter
|
expand
|
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index bc8d42f..fe65768 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -677,6 +677,7 @@ struct i2c_adapter { struct rt_mutex bus_lock; struct rt_mutex mux_lock; + u32 bus_freq_hz; int timeout; /* in jiffies */ int retries; struct device dev; /* the adapter device */
The clock-frequency property is not mandatory for the i2c buses. If it's not present in the device tree, the buses __usually__ assume it's 100kHZ (see altera, at91, axxia, etc.). Broadcom uses a 375kHZ default clock-frequency, so the default clock frequency varies from bus to bus. There are i2c clients that need to know the bus clock frequency in order to compute their wake token (see atecc508a i2c client). The clock-frequency value has to be propagated to the i2c clients, otherwise, if they will not find the i2c bus clock frequency in the device tree, they will have to make their own assumption of the clock frequency. Spare the i2c clients of making wrong assumptions of the i2c bus clock frequency and enable the buses to save their clock frequency in adapter. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> --- include/linux/i2c.h | 1 + 1 file changed, 1 insertion(+)