Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3223471rdg; Tue, 17 Oct 2023 08:07:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJoD/uoIjUQcu08SeoCM8E9+TVmYr6ceRKqz6NZBNmANph1gwivWV5DlIdPMkPrxk48fME X-Received: by 2002:a17:902:db0f:b0:1c8:91d8:d5c5 with SMTP id m15-20020a170902db0f00b001c891d8d5c5mr3343920plx.55.1697555234784; Tue, 17 Oct 2023 08:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697555234; cv=none; d=google.com; s=arc-20160816; b=UTpwEFjHvn7RejekqqFY9itqwyLpxzkQSWytyx/Dl/epl+lyxlkGIAA6H3EogrmV6S Vcp9+wEwUPhfBjw5eus+koxjZPyrUzmZnkYfRENeLC4oD3C9L1ip/lhHvowb6Qwm+wn8 2Q18mhVXrREMHtXJWqvTOwNKyUBWWmFgsoK3V3O3SD4i5n8WSxZ3+pdpKAy4dK4HsIx1 skPWQHVk3KD1zpyOj+yiMKwO8vBdTjI4MaKLcMPMjmCjQwanFa+mT4mUstjnXiSJgTnN BYS93JofBRAGxgCKMcA9UIXmlSqmlDbZd/FBvoam18+CLs3Tx06mUhCzTXFu8PqsiYAL ECUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hRxv/xQHCbwfjsFwBDzlBOcscTMXDoiVeykMIgqT/70=; fh=dOm26d9WdwdXzbLIJs1gP/Nz3sQ32tWN9JaCg2IU+7Q=; b=UxPif36cpm7n1rxoc7eCruOqGKDseqEIIfYzS51VjXfd0dRUidODhjFhwCOBhMgRto 3U7MNrL5ZmH+G4eOV6oJQkRZGc9iAW35bCzJV4Q6H5YiF1FdrCNiDtDqdOxXqUPI3Olz jJIMb2NQO1y31HkRobjOtKWReOtjiRRE6NwJie+U1V9CAWUBFlVOHzy3TEc8vbIsWY/M j220zoxlNy9aav3haH/erpIp31WGYTRKUxMnE+587cwSKJFC4xffjYJVM63AtaJ+y60l ycLbelibe9yNYwpbiLGR1AKOZi8c1B2p03ZVsJKnQuR5DEC04RZSZqpv/Bak2/Lo31Lu RoZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=O5jQAQgV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id c4-20020a170902aa4400b001c76b4c349esi1909805plr.218.2023.10.17.08.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 08:07:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=O5jQAQgV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B429F80B1BE1; Tue, 17 Oct 2023 08:06:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344250AbjJQPGw (ORCPT + 99 others); Tue, 17 Oct 2023 11:06:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344225AbjJQPGk (ORCPT ); Tue, 17 Oct 2023 11:06:40 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B421A2914F for ; Tue, 17 Oct 2023 07:58:45 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-27d45f5658fso3292182a91.3 for ; Tue, 17 Oct 2023 07:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1697554725; x=1698159525; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hRxv/xQHCbwfjsFwBDzlBOcscTMXDoiVeykMIgqT/70=; b=O5jQAQgVLRO+PsmmUqU7WgOMCOGrqtfXF0CKGR+wbchOJQikW/ovplka17+B2nYi0P Oo6XcoPnxrrDFsYSV+E5A8NSCuR1RP2O9zCfpr7EcyK/nuyHXJvLBPMnp8sq7lKalq4m G7Khv0n2ShqqDhcWlpSIs/Ocow8IC1ioGhHhsdrJwVfRrWq2wvUCIC4m6B7xulR8rFXr FnXQoYAqi/yxYBkqeAO/o6jxRWtWr8/K/M8LzBjFe3S7QOaLz4M9lDzWkSxMYkC1o52y pS8ZWyjq03Fzxoh2ucBFLH8cqIW1G371ekX+OWTStW/BhtDQwLAbXsirMB8Mb35wnZGg Xrow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697554725; x=1698159525; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hRxv/xQHCbwfjsFwBDzlBOcscTMXDoiVeykMIgqT/70=; b=FyBM4O9IgR65yTMnKJpymh2Ou2ERaTm6Yo1ca4v/f6ZggnJubqf0Un/i0SQWOsBU7q 1cWMy8vDGTXTRDo9m3zpDSBPQWsoTlcrR+lhdpHj9iWUlYn8UUqo1zLe8pThNO8N9F4q TkwQtHMAPFqswoZIQMmEMelkjz4fIZ+yppk14//MPafIjsWr1rzrSgyGPsB22gHHXOKI FdaaNDccLsj8icwbrzoxEKK01YpBmjCbdi5I/VyjQ4pDG1G7HgXKLZv/xbLnDzGmlfzK ccxBxk5oRA979fSGGc91XEMTIYXbp1iuZPY+nwc5hH0lnRXZY0EdMMOv7NhNlSlevOoz K8zA== X-Gm-Message-State: AOJu0Yw1SDtZMGg0F+vtYElBcqm3vk/kWjwvGm5KzqfNs9gxyuwB8FJW 9+mJY2qV8jf+EwCGOrpS66fM7Pi9KzA/ZQZlbqZ0ug== X-Received: by 2002:a17:90b:1058:b0:27d:6dd:fb7d with SMTP id gq24-20020a17090b105800b0027d06ddfb7dmr2488553pjb.17.1697554725068; Tue, 17 Oct 2023 07:58:45 -0700 (PDT) MIME-Version: 1.0 References: <20231005134541.947727-1-naresh.solanki@9elements.com> <20231005134541.947727-2-naresh.solanki@9elements.com> <29485a37-1f45-9f7f-9cc5-5d6a9fcc5e08@axentia.se> In-Reply-To: <29485a37-1f45-9f7f-9cc5-5d6a9fcc5e08@axentia.se> From: Naresh Solanki Date: Tue, 17 Oct 2023 20:28:36 +0530 Message-ID: Subject: Re: [PATCH v4 2/2] i2c: muxes: pca954x: Enable features on MAX7357 To: Peter Rosin Cc: Patrick Rudolph , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 17 Oct 2023 08:06:58 -0700 (PDT) Hi On Fri, 6 Oct 2023 at 13:16, Peter Rosin wrote: > > Hi! > > 2023-10-05 at 15:45, Naresh Solanki wrote: > > From: Patrick Rudolph > > > > Enable additional features based on DT settings and unconditionally > > release the shared interrupt pin after 1.6 seconds and allow to use > > it as reset. > > > > These features aren't enabled by default & its up to board designer > > to enable the same as it may have unexpected side effects. > > > > These should be validated for proper functioning & detection of devices > > in secondary bus as sometimes it can cause secondary bus being disabled. > > > > Signed-off-by: Patrick Rudolph > > Signed-off-by: Naresh Solanki > > --- > > Changes in V4: > > - Drop max7358 > > - Update #define > > - Move conf variable > > - Print warning when I2C_FUNC_SMBUS_WRITE_BYTE_DATA isn't supported > > Changes in V3: > > - Delete unused #define > > - Update pca954x_init > > - Update commit message > > > > Changes in V2: > > - Update comments > > - Update check for DT properties > > --- > > drivers/i2c/muxes/i2c-mux-pca954x.c | 44 ++++++++++++++++++++++++++++- > > 1 file changed, 43 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c > > index 2219062104fb..f37ce332078c 100644 > > --- a/drivers/i2c/muxes/i2c-mux-pca954x.c > > +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c > > @@ -57,6 +57,20 @@ > > > > #define PCA954X_IRQ_OFFSET 4 > > > > +/* > > + * MAX7357's configuration register is writeable after POR, but > > + * can be locked by setting the basic mode bit. MAX7358 configuration > > + * register is locked by default and needs to be unlocked first. > > + * The configuration register holds the following settings: > > + */ > > +#define MAX7357_CONF_INT_ENABLE BIT(0) > > +#define MAX7357_CONF_FLUSH_OUT BIT(1) > > +#define MAX7357_CONF_RELEASE_INT BIT(2) > > +#define MAX7357_CONF_DISCON_SINGLE_CHAN BIT(4) > > +#define MAX7357_CONF_PRECONNECT_TEST BIT(7) > > + > > +#define MAX7357_POR_DEFAULT_CONF MAX7357_CONF_INT_ENABLE > > + > > enum pca_type { > > max_7356, > > max_7357, > > @@ -470,7 +484,35 @@ static int pca954x_init(struct i2c_client *client, struct pca954x *data) > > else > > data->last_chan = 0; /* Disconnect multiplexer */ > > > > - ret = i2c_smbus_write_byte(client, data->last_chan); > > + if (device_is_compatible(&client->dev, "maxim,max7357")) { > > + if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { > > + u8 conf = MAX7357_POR_DEFAULT_CONF; > > + /* > > + * The interrupt signal is shared with the reset pin. Release the > > + * interrupt after 1.6 seconds to allow using the pin as reset. > > + * The interrupt isn't serviced yet. > > I'd suggest dropping the word "yet". The interrupt isn't serviced for > max7357, period. The "yet" in combination with that 1.6 second window is > a bit cunfusing and readers might think that the interrupt is serviced > at some later stage or something, when I think the intention of "The > interrupt isn't serviced yet" comes with the silent implication that it > is simply not implemented yet. Sure. > > > + */ > > + conf |= MAX7357_CONF_RELEASE_INT; > > + > > + if (device_property_read_bool(&client->dev, "maxim,isolate-stuck-channel")) > > + conf |= MAX7357_CONF_DISCON_SINGLE_CHAN; > > + if (device_property_read_bool(&client->dev, > > + "maxim,send-flush-out-sequence")) > > + conf |= MAX7357_CONF_FLUSH_OUT; > > + if (device_property_read_bool(&client->dev, > > + "maxim,preconnection-wiggle-test-enable")) > > + conf |= MAX7357_CONF_PRECONNECT_TEST; > > + > > + ret = i2c_smbus_write_byte_data(client, data->last_chan, conf); > > + } else { > > + dev_warn(&client->dev, > > + "Write byte not supported. Cannot enable enhanced mode features"); > > Missing \n at the end of the string. Sure. Will also update it as 'Write byte data not supported. Cannot enable enhanced mode features\n' Regards, Naresh > > Cheers, > Peter > > > + ret = i2c_smbus_write_byte(client, data->last_chan); > > + } > > + } else { > > + ret = i2c_smbus_write_byte(client, data->last_chan); > > + } > > + > > if (ret < 0) > > data->last_chan = 0; > >