From patchwork Mon Mar 26 11:19:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10307637 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 1D41C600CC for ; Mon, 26 Mar 2018 11:20:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AE972962A for ; Mon, 26 Mar 2018 11:20:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2ECC2963E; Mon, 26 Mar 2018 11:20:00 +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 8375C2962A for ; Mon, 26 Mar 2018 11:20:00 +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: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:In-Reply-To:References: List-Owner; bh=lpOttjvwVa8Uu8tlYVvbaC0FfHEkefxLXVfkTsRTTcs=; b=QjZPGLwW0X4Z/B QAXCJ7Mk/uo9vF1vXTUfcnKsbMMoLfxLq1mW3EL5BxVOn3qXHRFnHEWM8IF7BLPt0+qfSvbCnobgZ 7502+VLLl2aElytGzIMf4qOM49ERlHqxe9FnUVBPo8YHZnquD2LZNwy8NSb47v34e911HjXiTUatj lSWk3WMIhvk7fN3y5J7IuRd8kNeEwHzcTCL/bSMjwRWlGzmNimqqDubm80FiZ7Qfvu4yzPeE+zSrB iXHqs+anbMFihZ2LiStw3RfwqGXgKMZ9aw6xvAiFsFKMm2NJZedSNHuB2ZTKG/ELK7hKJQK9I1N1z agREz1Uuf/DK95UPsKsA==; 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 1f0QAL-00059Q-0T; Mon, 26 Mar 2018 11:19:53 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0QAI-00057r-Bd for linux-arm-kernel@lists.infradead.org; Mon, 26 Mar 2018 11:19:51 +0000 X-IronPort-AV: E=Sophos;i="5.48,364,1517900400"; d="scan'208";a="10023348" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 26 Mar 2018 04:19:37 -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:36 -0700 From: Tudor Ambarus To: , , , , , Subject: [RFC PATCH 1/2] i2c: add bus_freq_hz in i2c_adapter Date: Mon, 26 Mar 2018 14:19:26 +0300 Message-ID: <20180326111927.16040-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.9.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180326_041950_433616_2E2BA572 X-CRM114-Status: UNSURE ( 8.84 ) 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 asume that it is 100kHZ. There are i2c clients that need to know the i2c bus frequency in order to compute their wake token. Spare the clients of making (wrong) assumptions and save the bus frequency in the i2c_adapter structure. Signed-off-by: Tudor Ambarus --- include/linux/i2c.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 44ad14e..7a1f26e 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -671,6 +671,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 */