Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4470301ybi; Tue, 11 Jun 2019 07:11:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxjrr4bb8GRU2yqRpxP6VqpHX9/kq6OR5CLiv1YhJ1Mp1Q/P9/xAGGBmAWFEHolqFDUU1q X-Received: by 2002:a17:90a:5d09:: with SMTP id s9mr26382784pji.120.1560262311003; Tue, 11 Jun 2019 07:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560262310; cv=none; d=google.com; s=arc-20160816; b=G2cFDt3r7uSpkL+4Iin1aVtqDlhK+AevnaX1xkR2dkv+k3+sl9kRkHmvg1ezLIHMa0 b0rUaROzb88xp6zGDB4yvY1Z+ll0T02zif8RBpU1yse+LB8v01SoX6dFWlZo1mtc+mQK ZHYPaBEVscKTLLBlxXqt9RaNG5aRjhBKiGNdtNkfYWLhSs4y2whHaH9i2n2fQjCHEL9R VHGVGIcjtoq3HLPuXnPTb3g0fmi3cxc7GaPX8sgOXhfCKGQFvL7GZfICEDcCkcUdPPs9 ga6AoGg1TfxFuwcPLJAiQiATYNniPkzIpN3LYunf/1GAx9TAcaV5RndyInxWbOnp1MyG 4ISg== 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=qmQirEAo+HkihQg/ddu5S4unU9LL8ivKmpYboa5BmFI=; b=C+z3wtw068q9UKFHCHUG1IQJ/uI4X6sgDM+mdR5b6RTScjamom4vvesxKWGduYHpCj PLt99ABqGLhivmJsBRr5RQmHDJP4gnBbn+JjgWDt2Hc2ik45Y1urMtvdtX25VlKMc7ht pVw0JFdte47dEaNDphlmuGqScJ4iVcfMxWjRIiLFwjlBoiKkMhxQySknU4xhvLruEzR9 /Rb1ayl1BsU5IXkfZIS3VIwhdqENfoiC8t3CSXB7jf4Z8yN6syAc77b51RHQwHe1Lequ oIMYae3gTqWOdc6ZrHTWHw+ONMQV/C5/F7QJzUE4l+IpG3gtuOmHXzGj94ghhj9wMXav eEgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=V0oDQSJW; 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 d30si3036841pld.218.2019.06.11.07.11.34; Tue, 11 Jun 2019 07:11:50 -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=V0oDQSJW; 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 S2390864AbfFKOGx (ORCPT + 99 others); Tue, 11 Jun 2019 10:06:53 -0400 Received: from dc2-smtprelay2.synopsys.com ([198.182.61.142]:42576 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387662AbfFKOGv (ORCPT ); Tue, 11 Jun 2019 10:06:51 -0400 Received: from mailhost.synopsys.com (unknown [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id C28C9C592D; Tue, 11 Jun 2019 14:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1560262009; bh=Y3sMwfqtu4jhDptZ3O+9CpvF/YCnpXaDr+JEzu9WStQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=V0oDQSJWcbW9rULv+rQZi0QdFm65nx0FnUhjRyVKpb14nhfZ5VhigsF0u3onBxcIR I6zrGzMI1ZtnOQpWhWGEDKLL+O7M7/gR57n3MBUCbUOAXT5WspJQv88UrldQtS/Hig MYZUZd/QPpzOx8YGvxGh7rIrTaQv/iSheo7FmrdeVUheIoyo7DqN9k49ElYki4POCr mvRrEl1mKN0etb2h/z6rU2qpyl4NeULe8T1WIYqlvMwXX6M31G6WoCUnI8i2TcuMLd N42IrDnkk0IxOFS0kmJavq/mrjMhX2dDjaf/WD2MZr8l6J6B0H1GasTXZq+DUjBTg2 Aq20zxWEyICuA== Received: from de02.synopsys.com (germany.internal.synopsys.com [10.225.17.21]) by mailhost.synopsys.com (Postfix) with ESMTP id 2D844A022E; Tue, 11 Jun 2019 14:06:48 +0000 (UTC) Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by de02.synopsys.com (Postfix) with ESMTP id DAECD3F591; Tue, 11 Jun 2019 16:06:48 +0200 (CEST) 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 v3 2/3] i3c: add mixed limited bus mode Date: Tue, 11 Jun 2019 16:06:44 +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 defines a bus configuration where i2c devices don't have a 50ns filter but support SCL running at SDR max rate (12.5MHz). This patch introduces the limited bus mode so that users can use a higher speed in presence of i2c devices index 1. Signed-off-by: Vitor Soares Cc: Boris Brezillon Cc: --- Changes in v3: None Changes in v2: Enhance commit message 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 f8e580e..025925c 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -470,6 +470,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", }; @@ -585,6 +586,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) @@ -2490,6 +2492,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 f13fd8b..89ea461 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