+++ /dev/null
-From 4017ec77dbd0717c41c779c4a5d7952ffc8b2285 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 24 Mar 2025 19:51:29 +0800
-Subject: ASoC: codec: wcd9335: Convert to GPIO descriptors
-
-From: Peng Fan <peng.fan@nxp.com>
-
-[ Upstream commit d5099bc1b56417733f4cccf10c61ee74dadd5562 ]
-
-of_gpio.h is deprecated, update the driver to use GPIO descriptors.
-- Use dev_gpiod_get to get GPIO descriptor.
-- Use gpiod_set_value to configure output value.
-
-With legacy of_gpio API, the driver set gpio value 0 to assert reset,
-and 1 to deassert reset. And the reset-gpios use GPIO_ACTIVE_LOW flag in
-DTS, so set GPIOD_OUT_LOW when get GPIO descriptors, and set value 1 means
-output low, set value 0 means output high with gpiod API.
-
-The in-tree DTS files have the right polarity set up already so we can
-expect this to "just work"
-
-Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Peng Fan <peng.fan@nxp.com>
-Link: https://patch.msgid.link/20250324-wcd-gpiod-v2-3-773f67ce3b56@nxp.com
-Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Signed-off-by: Mark Brown <broonie@kernel.org>
-Stable-dep-of: 9079db287fc3 ("ASoC: codecs: wcd9335: Fix missing free of regulator supplies")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- sound/soc/codecs/wcd9335.c | 15 +++++++--------
- 1 file changed, 7 insertions(+), 8 deletions(-)
-
-diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
-index dc4ce2c3f2188..08b7ca26c3c97 100644
---- a/sound/soc/codecs/wcd9335.c
-+++ b/sound/soc/codecs/wcd9335.c
-@@ -16,7 +16,7 @@
- #include <sound/soc.h>
- #include <sound/pcm_params.h>
- #include <sound/soc-dapm.h>
--#include <linux/of_gpio.h>
-+#include <linux/gpio/consumer.h>
- #include <linux/of.h>
- #include <linux/of_irq.h>
- #include <sound/tlv.h>
-@@ -338,7 +338,7 @@ struct wcd9335_codec {
- int comp_enabled[COMPANDER_MAX];
-
- int intr1;
-- int reset_gpio;
-+ struct gpio_desc *reset_gpio;
- struct regulator_bulk_data supplies[WCD9335_MAX_SUPPLY];
-
- unsigned int rx_port_value;
-@@ -5024,12 +5024,11 @@ static const struct regmap_irq_chip wcd9335_regmap_irq1_chip = {
- static int wcd9335_parse_dt(struct wcd9335_codec *wcd)
- {
- struct device *dev = wcd->dev;
-- struct device_node *np = dev->of_node;
- int ret;
-
-- wcd->reset_gpio = of_get_named_gpio(np, "reset-gpios", 0);
-- if (wcd->reset_gpio < 0)
-- return dev_err_probe(dev, wcd->reset_gpio, "Reset GPIO missing from DT\n");
-+ wcd->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
-+ if (IS_ERR(wcd->reset_gpio))
-+ return dev_err_probe(dev, PTR_ERR(wcd->reset_gpio), "Reset GPIO missing from DT\n");
-
- wcd->mclk = devm_clk_get(dev, "mclk");
- if (IS_ERR(wcd->mclk))
-@@ -5072,9 +5071,9 @@ static int wcd9335_power_on_reset(struct wcd9335_codec *wcd)
- */
- usleep_range(600, 650);
-
-- gpio_direction_output(wcd->reset_gpio, 0);
-+ gpiod_set_value(wcd->reset_gpio, 1);
- msleep(20);
-- gpio_set_value(wcd->reset_gpio, 1);
-+ gpiod_set_value(wcd->reset_gpio, 0);
- msleep(20);
-
- return 0;
---
-2.39.5
-
Link: https://patch.msgid.link/20250526-b4-b4-asoc-wcd9395-vdd-px-fixes-v1-1-0b8a2993b7d3@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- sound/soc/codecs/wcd9335.c | 25 +++++++------------------
+ sound/soc/codecs/wcd9335.c | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
-diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
-index 08b7ca26c3c97..f20d0c9e91e49 100644
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -339,7 +339,6 @@ struct wcd9335_codec {
int intr1;
- struct gpio_desc *reset_gpio;
+ int reset_gpio;
- struct regulator_bulk_data supplies[WCD9335_MAX_SUPPLY];
unsigned int rx_port_value;
static const struct wcd9335_slim_ch wcd9335_tx_chs[WCD9335_TX_MAX] = {
WCD9335_SLIM_TX_CH(0),
WCD9335_SLIM_TX_CH(1),
-@@ -5038,30 +5041,16 @@ static int wcd9335_parse_dt(struct wcd9335_codec *wcd)
+@@ -5039,30 +5042,16 @@ static int wcd9335_parse_dt(struct wcd93
if (IS_ERR(wcd->native_clk))
return dev_err_probe(dev, PTR_ERR(wcd->native_clk), "slimbus clock not found\n");
/*
* For WCD9335, it takes about 600us for the Vout_A and
* Vout_D to be ready after BUCK_SIDO is powered up.
---
-2.39.5
-
+++ /dev/null
-From 64ee9f643e651bf0a2afa5976e4667c6ab2d8c74 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri, 12 Aug 2022 13:10:37 +0300
-Subject: regulator: Add devm helpers for get and enable
-
-From: Matti Vaittinen <mazziesaccount@gmail.com>
-
-[ Upstream commit da279e6965b3838e99e5c0ab8f76b87bf86b31a5 ]
-
-A few regulator consumer drivers seem to be just getting a regulator,
-enabling it and registering a devm-action to disable the regulator at
-the driver detach and then forget about it.
-
-We can simplify this a bit by adding a devm-helper for this pattern.
-Add devm_regulator_get_enable() and devm_regulator_get_enable_optional()
-
-Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
-Link: https://lore.kernel.org/r/ed7b8841193bb9749d426f3cb3b199c9460794cd.1660292316.git.mazziesaccount@gmail.com
-Signed-off-by: Mark Brown <broonie@kernel.org>
-Stable-dep-of: 9079db287fc3 ("ASoC: codecs: wcd9335: Fix missing free of regulator supplies")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/regulator/devres.c | 164 +++++++++++++++++++++++++++++
- include/linux/regulator/consumer.h | 27 +++++
- 2 files changed, 191 insertions(+)
-
-diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c
-index 32823a87fd409..3265e75e97ab4 100644
---- a/drivers/regulator/devres.c
-+++ b/drivers/regulator/devres.c
-@@ -70,6 +70,65 @@ struct regulator *devm_regulator_get_exclusive(struct device *dev,
- }
- EXPORT_SYMBOL_GPL(devm_regulator_get_exclusive);
-
-+static void regulator_action_disable(void *d)
-+{
-+ struct regulator *r = (struct regulator *)d;
-+
-+ regulator_disable(r);
-+}
-+
-+static int _devm_regulator_get_enable(struct device *dev, const char *id,
-+ int get_type)
-+{
-+ struct regulator *r;
-+ int ret;
-+
-+ r = _devm_regulator_get(dev, id, get_type);
-+ if (IS_ERR(r))
-+ return PTR_ERR(r);
-+
-+ ret = regulator_enable(r);
-+ if (!ret)
-+ ret = devm_add_action_or_reset(dev, ®ulator_action_disable, r);
-+
-+ if (ret)
-+ devm_regulator_put(r);
-+
-+ return ret;
-+}
-+
-+/**
-+ * devm_regulator_get_enable_optional - Resource managed regulator get and enable
-+ * @dev: device to supply
-+ * @id: supply name or regulator ID.
-+ *
-+ * Get and enable regulator for duration of the device life-time.
-+ * regulator_disable() and regulator_put() are automatically called on driver
-+ * detach. See regulator_get_optional() and regulator_enable() for more
-+ * information.
-+ */
-+int devm_regulator_get_enable_optional(struct device *dev, const char *id)
-+{
-+ return _devm_regulator_get_enable(dev, id, OPTIONAL_GET);
-+}
-+EXPORT_SYMBOL_GPL(devm_regulator_get_enable_optional);
-+
-+/**
-+ * devm_regulator_get_enable - Resource managed regulator get and enable
-+ * @dev: device to supply
-+ * @id: supply name or regulator ID.
-+ *
-+ * Get and enable regulator for duration of the device life-time.
-+ * regulator_disable() and regulator_put() are automatically called on driver
-+ * detach. See regulator_get() and regulator_enable() for more
-+ * information.
-+ */
-+int devm_regulator_get_enable(struct device *dev, const char *id)
-+{
-+ return _devm_regulator_get_enable(dev, id, NORMAL_GET);
-+}
-+EXPORT_SYMBOL_GPL(devm_regulator_get_enable);
-+
- /**
- * devm_regulator_get_optional - Resource managed regulator_get_optional()
- * @dev: device to supply
-@@ -194,6 +253,111 @@ int devm_regulator_bulk_get_const(struct device *dev, int num_consumers,
- }
- EXPORT_SYMBOL_GPL(devm_regulator_bulk_get_const);
-
-+static int devm_regulator_bulk_match(struct device *dev, void *res,
-+ void *data)
-+{
-+ struct regulator_bulk_devres *match = res;
-+ struct regulator_bulk_data *target = data;
-+
-+ /*
-+ * We check the put uses same consumer list as the get did.
-+ * We _could_ scan all entries in consumer array and check the
-+ * regulators match but ATM I don't see the need. We can change this
-+ * later if needed.
-+ */
-+ return match->consumers == target;
-+}
-+
-+/**
-+ * devm_regulator_bulk_put - Resource managed regulator_bulk_put()
-+ * @consumers: consumers to free
-+ *
-+ * Deallocate regulators allocated with devm_regulator_bulk_get(). Normally
-+ * this function will not need to be called and the resource management
-+ * code will ensure that the resource is freed.
-+ */
-+void devm_regulator_bulk_put(struct regulator_bulk_data *consumers)
-+{
-+ int rc;
-+ struct regulator *regulator = consumers[0].consumer;
-+
-+ rc = devres_release(regulator->dev, devm_regulator_bulk_release,
-+ devm_regulator_bulk_match, consumers);
-+ if (rc != 0)
-+ WARN_ON(rc);
-+}
-+EXPORT_SYMBOL_GPL(devm_regulator_bulk_put);
-+
-+static void devm_regulator_bulk_disable(void *res)
-+{
-+ struct regulator_bulk_devres *devres = res;
-+ int i;
-+
-+ for (i = 0; i < devres->num_consumers; i++)
-+ regulator_disable(devres->consumers[i].consumer);
-+}
-+
-+/**
-+ * devm_regulator_bulk_get_enable - managed get'n enable multiple regulators
-+ *
-+ * @dev: device to supply
-+ * @num_consumers: number of consumers to register
-+ * @id: list of supply names or regulator IDs
-+ *
-+ * @return 0 on success, an errno on failure.
-+ *
-+ * This helper function allows drivers to get several regulator
-+ * consumers in one operation with management, the regulators will
-+ * automatically be freed when the device is unbound. If any of the
-+ * regulators cannot be acquired then any regulators that were
-+ * allocated will be freed before returning to the caller.
-+ */
-+int devm_regulator_bulk_get_enable(struct device *dev, int num_consumers,
-+ const char * const *id)
-+{
-+ struct regulator_bulk_devres *devres;
-+ struct regulator_bulk_data *consumers;
-+ int i, ret;
-+
-+ devres = devm_kmalloc(dev, sizeof(*devres), GFP_KERNEL);
-+ if (!devres)
-+ return -ENOMEM;
-+
-+ devres->consumers = devm_kcalloc(dev, num_consumers, sizeof(*consumers),
-+ GFP_KERNEL);
-+ consumers = devres->consumers;
-+ if (!consumers)
-+ return -ENOMEM;
-+
-+ devres->num_consumers = num_consumers;
-+
-+ for (i = 0; i < num_consumers; i++)
-+ consumers[i].supply = id[i];
-+
-+ ret = devm_regulator_bulk_get(dev, num_consumers, consumers);
-+ if (ret)
-+ return ret;
-+
-+ for (i = 0; i < num_consumers; i++) {
-+ ret = regulator_enable(consumers[i].consumer);
-+ if (ret)
-+ goto unwind;
-+ }
-+
-+ ret = devm_add_action(dev, devm_regulator_bulk_disable, devres);
-+ if (!ret)
-+ return 0;
-+
-+unwind:
-+ while (--i >= 0)
-+ regulator_disable(consumers[i].consumer);
-+
-+ devm_regulator_bulk_put(consumers);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(devm_regulator_bulk_get_enable);
-+
- static void devm_rdev_release(struct device *dev, void *res)
- {
- regulator_unregister(*(struct regulator_dev **)res);
-diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
-index 61f922e6fe353..a1fce0f27ce16 100644
---- a/include/linux/regulator/consumer.h
-+++ b/include/linux/regulator/consumer.h
-@@ -203,6 +203,8 @@ struct regulator *__must_check regulator_get_optional(struct device *dev,
- const char *id);
- struct regulator *__must_check devm_regulator_get_optional(struct device *dev,
- const char *id);
-+int devm_regulator_get_enable(struct device *dev, const char *id);
-+int devm_regulator_get_enable_optional(struct device *dev, const char *id);
- void regulator_put(struct regulator *regulator);
- void devm_regulator_put(struct regulator *regulator);
-
-@@ -240,12 +242,15 @@ int __must_check regulator_bulk_get(struct device *dev, int num_consumers,
- struct regulator_bulk_data *consumers);
- int __must_check devm_regulator_bulk_get(struct device *dev, int num_consumers,
- struct regulator_bulk_data *consumers);
-+void devm_regulator_bulk_put(struct regulator_bulk_data *consumers);
- int __must_check devm_regulator_bulk_get_const(
- struct device *dev, int num_consumers,
- const struct regulator_bulk_data *in_consumers,
- struct regulator_bulk_data **out_consumers);
- int __must_check regulator_bulk_enable(int num_consumers,
- struct regulator_bulk_data *consumers);
-+int devm_regulator_bulk_get_enable(struct device *dev, int num_consumers,
-+ const char * const *id);
- int regulator_bulk_disable(int num_consumers,
- struct regulator_bulk_data *consumers);
- int regulator_bulk_force_disable(int num_consumers,
-@@ -350,6 +355,17 @@ devm_regulator_get_exclusive(struct device *dev, const char *id)
- return ERR_PTR(-ENODEV);
- }
-
-+static inline int devm_regulator_get_enable(struct device *dev, const char *id)
-+{
-+ return -ENODEV;
-+}
-+
-+static inline int devm_regulator_get_enable_optional(struct device *dev,
-+ const char *id)
-+{
-+ return -ENODEV;
-+}
-+
- static inline struct regulator *__must_check
- regulator_get_optional(struct device *dev, const char *id)
- {
-@@ -371,6 +387,10 @@ static inline void devm_regulator_put(struct regulator *regulator)
- {
- }
-
-+static inline void devm_regulator_bulk_put(struct regulator_bulk_data *consumers)
-+{
-+}
-+
- static inline int regulator_register_supply_alias(struct device *dev,
- const char *id,
- struct device *alias_dev,
-@@ -461,6 +481,13 @@ static inline int regulator_bulk_enable(int num_consumers,
- return 0;
- }
-
-+static inline int devm_regulator_bulk_get_enable(struct device *dev,
-+ int num_consumers,
-+ const char * const *id)
-+{
-+ return 0;
-+}
-+
- static inline int regulator_bulk_disable(int num_consumers,
- struct regulator_bulk_data *consumers)
- {
---
-2.39.5
-
+++ /dev/null
-From 80620341370aac64b78c5d2739d121bfa0a3c5ce Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 26 Jul 2022 10:38:23 -0700
-Subject: regulator: core: Allow drivers to define their init data as const
-
-From: Douglas Anderson <dianders@chromium.org>
-
-[ Upstream commit 1de452a0edda26f1483d1d934f692eab13ba669a ]
-
-Drivers tend to want to define the names of their regulators somewhere
-in their source file as "static const". This means, inevitable, that
-every driver out there open codes something like this:
-
-static const char * const supply_names[] = {
- "vcc", "vccl",
-};
-
-static int get_regulators(struct my_data *data)
-{
- int i;
-
- data->supplies = devm_kzalloc(...)
- if (!data->supplies)
- return -ENOMEM;
-
- for (i = 0; i < ARRAY_SIZE(supply_names); i++)
- data->supplies[i].supply = supply_names[i];
-
- return devm_regulator_bulk_get(data->dev,
- ARRAY_SIZE(supply_names),
- data->supplies);
-}
-
-Let's make this more convenient by doing providing a helper that does
-the copy.
-
-I have chosen to have the "const" input structure here be the exact
-same structure as the normal one passed to
-devm_regulator_bulk_get(). This is slightly inefficent since the input
-data can't possibly have anything useful for "ret" or consumer and
-thus we waste 8 bytes per structure. This seems an OK tradeoff for not
-introducing an extra structure.
-
-Signed-off-by: Douglas Anderson <dianders@chromium.org>
-Link: https://lore.kernel.org/r/20220726103631.v2.6.I38fc508a73135a5c1b873851f3553ff2a3a625f5@changeid
-Signed-off-by: Mark Brown <broonie@kernel.org>
-Stable-dep-of: 9079db287fc3 ("ASoC: codecs: wcd9335: Fix missing free of regulator supplies")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/regulator/devres.c | 28 ++++++++++++++++++++++++++++
- include/linux/regulator/consumer.h | 4 ++++
- 2 files changed, 32 insertions(+)
-
-diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c
-index 9113233f41cd1..32823a87fd409 100644
---- a/drivers/regulator/devres.c
-+++ b/drivers/regulator/devres.c
-@@ -166,6 +166,34 @@ int devm_regulator_bulk_get(struct device *dev, int num_consumers,
- }
- EXPORT_SYMBOL_GPL(devm_regulator_bulk_get);
-
-+/**
-+ * devm_regulator_bulk_get_const - devm_regulator_bulk_get() w/ const data
-+ *
-+ * @dev: device to supply
-+ * @num_consumers: number of consumers to register
-+ * @in_consumers: const configuration of consumers
-+ * @out_consumers: in_consumers is copied here and this is passed to
-+ * devm_regulator_bulk_get().
-+ *
-+ * This is a convenience function to allow bulk regulator configuration
-+ * to be stored "static const" in files.
-+ *
-+ * Return: 0 on success, an errno on failure.
-+ */
-+int devm_regulator_bulk_get_const(struct device *dev, int num_consumers,
-+ const struct regulator_bulk_data *in_consumers,
-+ struct regulator_bulk_data **out_consumers)
-+{
-+ *out_consumers = devm_kmemdup(dev, in_consumers,
-+ num_consumers * sizeof(*in_consumers),
-+ GFP_KERNEL);
-+ if (*out_consumers == NULL)
-+ return -ENOMEM;
-+
-+ return devm_regulator_bulk_get(dev, num_consumers, *out_consumers);
-+}
-+EXPORT_SYMBOL_GPL(devm_regulator_bulk_get_const);
-+
- static void devm_rdev_release(struct device *dev, void *res)
- {
- regulator_unregister(*(struct regulator_dev **)res);
-diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
-index bbf6590a6dec2..61f922e6fe353 100644
---- a/include/linux/regulator/consumer.h
-+++ b/include/linux/regulator/consumer.h
-@@ -240,6 +240,10 @@ int __must_check regulator_bulk_get(struct device *dev, int num_consumers,
- struct regulator_bulk_data *consumers);
- int __must_check devm_regulator_bulk_get(struct device *dev, int num_consumers,
- struct regulator_bulk_data *consumers);
-+int __must_check devm_regulator_bulk_get_const(
-+ struct device *dev, int num_consumers,
-+ const struct regulator_bulk_data *in_consumers,
-+ struct regulator_bulk_data **out_consumers);
- int __must_check regulator_bulk_enable(int num_consumers,
- struct regulator_bulk_data *consumers);
- int regulator_bulk_disable(int num_consumers,
---
-2.39.5
-
drm-gem-fix-race-in-drm_gem_handle_create_tail.patch
usb-gadget-u_serial-fix-race-condition-in-tty-wakeup.patch
revert-acpi-battery-negate-current-when-discharging.patch
-regulator-core-allow-drivers-to-define-their-init-da.patch
-regulator-add-devm-helpers-for-get-and-enable.patch
asoc-codecs-wcd9335-handle-nicer-probe-deferral-and-.patch
-asoc-codec-wcd9335-convert-to-gpio-descriptors.patch
asoc-codecs-wcd9335-fix-missing-free-of-regulator-su.patch
btrfs-propagate-last_unlink_trans-earlier-when-doing.patch
btrfs-use-btrfs_record_snapshot_destroy-during-rmdir.patch
rdma-mlx5-fix-vport-loopback-for-mpv-device.patch
pwm-mediatek-ensure-to-disable-clocks-in-error-path.patch
+netlink-fix-rmem-check-in-netlink_broadcast_deliver.patch
+netlink-make-sure-we-allow-at-least-one-dump-skb.patch