Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2448507yba; Mon, 15 Apr 2019 11:51:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpgWeZP7Y8lG7e0Ez5BVuuwFGy7CFItAZSeC/LWBfOzqu62WsDr1w8vlgn6RYu679m5QB5 X-Received: by 2002:a17:902:b489:: with SMTP id y9mr68829567plr.17.1555354301119; Mon, 15 Apr 2019 11:51:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555354301; cv=none; d=google.com; s=arc-20160816; b=vuzyFTqY9islKcJNynKa2X8L4kLeVY12ThrJnaByhapc1knxNxijpANwXwqYjEKIDJ p7DGllY8OQ2E8YVP5mSatSj5axd1yo36v//0QDldPQrm9+goDC64GA0mkm1cgfHgu0LL skAiFZ9IxVlqyA0EC1ca4pklTcsNdT413Ghgtn3cNcNW3xMKaoKopBxx7XUMQC4ZqG38 /GoJ31V/MYh9uF6DA6ak3xQVynKHlsBRwhU5WuhVYNu/MkL/yLgVVrJzSjDJF8RKCU76 CXNDq5LOupyVb7EA4NhTifE+uzmZHyCSSdc2/7ykM7U3p/hZT1I12Q8pJV2/PPbT+LOJ gKNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=557iQYJ9V0f/oEp16NN+ICgfD0ZnRjtr10VwHuCyu88=; b=URuXjlHQNN4DpxctM/CPybaha+6qhxbfCzqe6YbjfRp8cJzgobPkqCw12flv5G5ZRU yci/agV/DxO+zt30Gj8T9BPhRIaWvd+GGqDxtV6VUS6y4VkKEfgxxEE1k3nrL4DruWjH 9hRS6d1mGwyjSM6PNTao0uvb8CXC86A0zsXtlYcfDuWYI9WHndIVFhW1eGEv2OiDqMuB D8M782hNAmkTqriy61d3Tbf4Gj7KzyqIHc4HBpSHGW4hgTZDZYzNyTFUG+FnmoM3TaY8 AcVZfgc8NBinvbSPYcHndSHjgFK99JTCmmdJLHD3czI1YyDysxXNsCwXn4GAV3xOGbkY l6DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=QpHKQExW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 196si31875024pgb.295.2019.04.15.11.51.25; Mon, 15 Apr 2019 11:51:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=QpHKQExW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728741AbfDOSqx (ORCPT + 99 others); Mon, 15 Apr 2019 14:46:53 -0400 Received: from smtprelay2.synopsys.com ([198.182.60.111]:55706 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728721AbfDOSqv (ORCPT ); Mon, 15 Apr 2019 14:46:51 -0400 Received: from mailhost1.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id F26BD10C1084; Mon, 15 Apr 2019 11:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1555354011; bh=n6inYUl0YHNqBHgFN/exfZfs4AjaXGG9AEqyDA7rheA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=QpHKQExWp3HSwvCwZXncuLsmdtCh2MQEaJaSugUeYLVOSYURwQVR1QA1sqJJUh+zf MXeEwMIywkkCMI+TFz+gsJFQdbLRZv04ZfqvyZQLYlEv3Id9iWF8TZbeHb5RM9UsBG D+BwF7fRuwhfeh9faRHmILIwpPTcqL7eTu3e5ZWNGw9rjALwt59jK2wWgLOFq/nc78 +6hf5wGP5pZngNIc+3gaGjIwyBYh4p42i5nIhEkJ9bYNMsMVGKEPzjICBK0wm9o2aX l+YCO+QYPv0hC81OsBo3i9eIQ219Lr+2BgBXaM8d/ekXsnhaIRCcvqpzl1FdUJ/wfO BFFe0XEolDKVQ== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost1.synopsys.com (Postfix) with ESMTP id AF22E5B73; Mon, 15 Apr 2019 11:46:49 -0700 (PDT) From: Vitor Soares To: linux-i3c@lists.infradead.org Cc: joao.pinto@synopsys.com, Vitor Soares , Boris Brezillon , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] i3c: add mixed limited bus mode Date: Mon, 15 Apr 2019 20:46:42 +0200 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The i3c bus spec define a bus configuration where the i2c devices doesn't have the 50ns filter yet they allow the SDR max speed. This patch introduce the limited bus mode so the users can use a higher speed on presence of i2c devices index 1. Signed-off-by: Vitor Soares Cc: Boris Brezillon Cc: --- drivers/i3c/master.c | 5 +++++ include/linux/i3c/master.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 1c4a86a..46d3774 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -463,6 +463,7 @@ static int i3c_bus_init(struct i3c_bus *i3cbus) static const char * const i3c_bus_mode_strings[] = { [I3C_BUS_MODE_PURE] = "pure", [I3C_BUS_MODE_MIXED_FAST] = "mixed-fast", + [I3C_BUS_MODE_MIXED_LIMITED] = "mixed-limited", [I3C_BUS_MODE_MIXED_SLOW] = "mixed-slow", }; @@ -575,6 +576,7 @@ int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode, i3cbus->scl_rate.i3c = I3C_BUS_TYP_I3C_SCL_RATE; break; case I3C_BUS_MODE_MIXED_FAST: + case I3C_BUS_MODE_MIXED_LIMITED: if (!i3cbus->scl_rate.i3c) i3cbus->scl_rate.i3c = I3C_BUS_TYP_I3C_SCL_RATE; if (!i3cbus->scl_rate.i2c) @@ -2481,6 +2483,9 @@ int i3c_master_register(struct i3c_master_controller *master, mode = I3C_BUS_MODE_MIXED_FAST; break; case I3C_LVR_I2C_INDEX(1): + if (mode < I3C_BUS_MODE_MIXED_LIMITED) + mode = I3C_BUS_MODE_MIXED_LIMITED; + break; case I3C_LVR_I2C_INDEX(2): if (mode < I3C_BUS_MODE_MIXED_SLOW) mode = I3C_BUS_MODE_MIXED_SLOW; diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h index 44fb3cf..740235e 100644 --- a/include/linux/i3c/master.h +++ b/include/linux/i3c/master.h @@ -250,12 +250,17 @@ struct i3c_device { * the bus. The only impact in this mode is that the * high SCL pulse has to stay below 50ns to trick I2C * devices when transmitting I3C frames + * @I3C_BUS_MODE_MIXED_LIMITED: I2C devices without 50ns spike filter are + * present on the bus. However they allows + * compliance up to the maximum SDR SCL clock + * frequency. * @I3C_BUS_MODE_MIXED_SLOW: I2C devices without 50ns spike filter are present * on the bus */ enum i3c_bus_mode { I3C_BUS_MODE_PURE, I3C_BUS_MODE_MIXED_FAST, + I3C_BUS_MODE_MIXED_LIMITED, I3C_BUS_MODE_MIXED_SLOW, }; -- 2.7.4