From nobody Sun Feb 8 05:27:31 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B34026B08F; Sun, 2 Nov 2025 10:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762078982; cv=none; b=SmC8EoRIoz8MvAeq76z562/fTCxT7xZZ0N+KdPsNIZylKPFOyagShxQLH4DJAmvEqTVO1Xr0EOJSPyaVHcbvSnJZGgXZwtBz1aIOTGXug1ckyViv9DwQFLe4XYtuUcf5FAliQU5b9kSWqtIaIhse02a9RSswOMjn1TmtMYohJsk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762078982; c=relaxed/simple; bh=paM6CQPxh4C3n81D8F6oMjgx9DMv0k+gpxswKZnGDdo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O6/J0ryzgNtnkmTS3yYS8P+ykyaHmsrlV+eowBtqkiuFK7z7otTCFzyLe8sSbKaZ7CPKn6k/WquQndVFLZ77J/lYJTSSqHCZoFUyRxV8I9kW4zJzlT9gCBrdY17TfHJxr+2BJZP6MFriKqz4D/8VrvY6V7kIudgMLmtxCtauej4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VdUQMdz1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VdUQMdz1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D01C9C116B1; Sun, 2 Nov 2025 10:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762078981; bh=paM6CQPxh4C3n81D8F6oMjgx9DMv0k+gpxswKZnGDdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VdUQMdz1md/0KgQ37V0wgDkybzAxaKJVHJrexHwEX9ukee3DTYtg9oSCXLOxh3exs uDNuE6bm13lhoLNHwChcvZSyuI28LcOiXiJqUkPisxGIlz6YBZvLq9Lg3Yb4n1zOPy rVMrUrsEreJ/Z/jixPy+kS8Nd8g1vA/7uFec2343r9GbaD5oH1cdeYTad+mOpDUhTl LtYWV7dd3M9BMWhDMvgTpXQx264eiibEOe/lXHtF6NHL0psjylkZiHkBC2yDi0EGpD UE1bDdgi/dLB19Nu7k8KLWYU7TQw7OqdnNjbUQAMeWWGdnipWCuy4+KOi4GiXyvBHK q1yiMkSjf9Zzw== From: Jisheng Zhang To: Linus Walleij , Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] gpio: fxl6408: Add optional reset gpio control Date: Sun, 2 Nov 2025 18:05:14 +0800 Message-ID: <20251102100515.9506-2-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20251102100515.9506-1-jszhang@kernel.org> References: <20251102100515.9506-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add optional active low reset-gpios pin control. If present, de-assert the specified reset gpio pin to bring the chip out of reset. Signed-off-by: Jisheng Zhang --- drivers/gpio/gpio-fxl6408.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpio/gpio-fxl6408.c b/drivers/gpio/gpio-fxl6408.c index 86ebc66b1104..ae520305f7a9 100644 --- a/drivers/gpio/gpio-fxl6408.c +++ b/drivers/gpio/gpio-fxl6408.c @@ -104,6 +104,7 @@ static int fxl6408_identify(struct device *dev, struct = regmap *regmap) static int fxl6408_probe(struct i2c_client *client) { struct device *dev =3D &client->dev; + struct gpio_desc *reset_gpio; int ret; struct gpio_regmap_config gpio_config =3D { .parent =3D dev, @@ -114,6 +115,10 @@ static int fxl6408_probe(struct i2c_client *client) .ngpio_per_reg =3D FXL6408_NGPIO, }; =20 + reset_gpio =3D devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(reset_gpio)) + return dev_err_probe(dev, PTR_ERR(reset_gpio), "Failed to get reset gpio= \n"); + gpio_config.regmap =3D devm_regmap_init_i2c(client, ®map); if (IS_ERR(gpio_config.regmap)) return dev_err_probe(dev, PTR_ERR(gpio_config.regmap), --=20 2.51.0 From nobody Sun Feb 8 05:27:31 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F326926E71B; Sun, 2 Nov 2025 10:23:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762078984; cv=none; b=r4uoZJm4H2pVBWWT2v/sJ+s35qZjP6yDtXTm1D0eCpY2m+5gpSrZWJiGZ7aDy5zp2okcStSHOWKJ2zdtPcv8cm7gCIi+oS9XTWqgH3PkK6r2mpMX/t/mVQGG6Gs8RlKp79+t0nfsS3JV3OunhsJ+096QfdUnypfG3qbqc3TE7XM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762078984; c=relaxed/simple; bh=Y8hWnynLiqeIN5xdT/N1ihtdP6znADV+s3faGr+WVNM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dMemjT+8T3DtHszCNl44ZIlmU00MD7SG0Ko0J1g0CzEEQdO398OyzoZ0Gm5mPVz6gLUePxCREpXlCxz0ImK6jqowD0m5BgylM9DLod3Gm+OpJsvilE3j5DNm9NR9EslioNaIYmykq224aqVMuCXD8vCTn4LlBrJMNKD2rBpwuV8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fyVxCaW3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fyVxCaW3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D6ABC4CEF7; Sun, 2 Nov 2025 10:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762078983; bh=Y8hWnynLiqeIN5xdT/N1ihtdP6znADV+s3faGr+WVNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fyVxCaW3JhUooT/8++TfY38faupalwIiZLLNJsWmG/WJUVu8JUWqMFtHcxRhxgXrd ubJ6QZCiqUeluqy0xUVLtueAy3MEhvhBUwkDgynNFmtFK3l8MJdVYj2P6WEpJTp5jg F29PAAOp6dUtfD91gZ48JjeUotdZrfBgOE6ik30iaIV2CozZnlJUqkkXnDd3HfKAYv AxzsMf5rBo1Ks98R40rE5E9XwRC/Jzo5Jhx/xxaPY8EfdhdcztZ9IGQ+3YQNK3oC3G q7UcbI+88TMXbcRqqcYWs9ekWoyuNXlhiA4/enrMk/cwfz0tBQPYeeV1oTiDrXyHf0 da+DKdUPBrC4w== From: Jisheng Zhang To: Linus Walleij , Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] gpio: fxl6408: Add suspend/resume support Date: Sun, 2 Nov 2025 18:05:15 +0800 Message-ID: <20251102100515.9506-3-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20251102100515.9506-1-jszhang@kernel.org> References: <20251102100515.9506-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently, during suspend, do nothing; during resume, just sync the regmap cache to hw regs. Signed-off-by: Jisheng Zhang --- drivers/gpio/gpio-fxl6408.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpio/gpio-fxl6408.c b/drivers/gpio/gpio-fxl6408.c index ae520305f7a9..805a623ef89c 100644 --- a/drivers/gpio/gpio-fxl6408.c +++ b/drivers/gpio/gpio-fxl6408.c @@ -43,6 +43,10 @@ =20 #define FXL6408_NGPIO 8 =20 +struct fxl6408_chip { + struct regmap *regmap; +}; + static const struct regmap_range rd_range[] =3D { { FXL6408_REG_DEVICE_ID, FXL6408_REG_DEVICE_ID }, { FXL6408_REG_IO_DIR, FXL6408_REG_OUTPUT }, @@ -105,6 +109,7 @@ static int fxl6408_probe(struct i2c_client *client) { struct device *dev =3D &client->dev; struct gpio_desc *reset_gpio; + struct fxl6408_chip *chip; int ret; struct gpio_regmap_config gpio_config =3D { .parent =3D dev, @@ -115,6 +120,10 @@ static int fxl6408_probe(struct i2c_client *client) .ngpio_per_reg =3D FXL6408_NGPIO, }; =20 + chip =3D devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL); + if (!chip) + return -ENOMEM; + reset_gpio =3D devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(reset_gpio)) return dev_err_probe(dev, PTR_ERR(reset_gpio), "Failed to get reset gpio= \n"); @@ -128,6 +137,9 @@ static int fxl6408_probe(struct i2c_client *client) if (ret) return ret; =20 + chip->regmap =3D gpio_config.regmap; + i2c_set_clientdata(client, chip); + /* Disable High-Z of outputs, so that our OUTPUT updates actually take ef= fect. */ ret =3D regmap_write(gpio_config.regmap, FXL6408_REG_OUTPUT_HIGH_Z, 0); if (ret) @@ -136,6 +148,16 @@ static int fxl6408_probe(struct i2c_client *client) return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(dev, &gpio_config)); } =20 +static int fxl6408_resume(struct device *dev) +{ + struct fxl6408_chip *chip =3D dev_get_drvdata(dev); + + regcache_mark_dirty(chip->regmap); + return regcache_sync(chip->regmap); +} + +static DEFINE_SIMPLE_DEV_PM_OPS(fxl6408_pm_ops, NULL, fxl6408_resume); + static const __maybe_unused struct of_device_id fxl6408_dt_ids[] =3D { { .compatible =3D "fcs,fxl6408" }, { } @@ -151,6 +173,7 @@ MODULE_DEVICE_TABLE(i2c, fxl6408_id); static struct i2c_driver fxl6408_driver =3D { .driver =3D { .name =3D "fxl6408", + .pm =3D pm_sleep_ptr(&fxl6408_pm_ops), .of_match_table =3D fxl6408_dt_ids, }, .probe =3D fxl6408_probe, --=20 2.51.0