get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2216136/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2216136,
    "url": "http://patchwork.ozlabs.org/api/patches/2216136/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260325-asoc-olpc-v1-1-ebe6de05c7e2@kernel.org/",
    "project": {
        "id": 42,
        "url": "http://patchwork.ozlabs.org/api/projects/42/?format=api",
        "name": "Linux GPIO development",
        "link_name": "linux-gpio",
        "list_id": "linux-gpio.vger.kernel.org",
        "list_email": "linux-gpio@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260325-asoc-olpc-v1-1-ebe6de05c7e2@kernel.org>",
    "list_archive_url": null,
    "date": "2026-03-25T21:46:36",
    "name": "RFT: x86_32: Move OLPC XO-1 audio GPIO to software nodes",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "388b7d3d21acb5b0658dd7f821aeff0e6e2af84a",
    "submitter": {
        "id": 92050,
        "url": "http://patchwork.ozlabs.org/api/people/92050/?format=api",
        "name": "Linus Walleij",
        "email": "linusw@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20260325-asoc-olpc-v1-1-ebe6de05c7e2@kernel.org/mbox/",
    "series": [
        {
            "id": 497515,
            "url": "http://patchwork.ozlabs.org/api/series/497515/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=497515",
            "date": "2026-03-25T21:46:36",
            "name": "RFT: x86_32: Move OLPC XO-1 audio GPIO to software nodes",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497515/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216136/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216136/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-gpio+bounces-34173-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-gpio@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=WtbI2QDA;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-34173-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"WtbI2QDA\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "Received": [
            "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fh0sK24Q0z1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 08:48:37 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 1B84D30E60E0\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 21:46:42 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id B491D3A873E;\n\tWed, 25 Mar 2026 21:46:41 +0000 (UTC)",
            "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 7644A2773DE;\n\tWed, 25 Mar 2026 21:46:41 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id EFD43C19423;\n\tWed, 25 Mar 2026 21:46:38 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774475201; cv=none;\n b=ZpEVy+Aea3rozCJ9iWu58HxVDp9RetvgfNIZwybZ/PoKOZHa1Yqp3RGdfaXxG5J+Xrp1sbM4jVfdWsUSBAnD+VQNzbwCSj+QhPAbIfhRdAO/jIXqyYG3PJHiSI6+mrgpL3DVSJC6cxo19K37sXFvk355GYWncsoiExqlC7acUWA=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774475201; c=relaxed/simple;\n\tbh=+ylu7bl+NpdgEU9QdSwkI5coZAZII7MT6smUgsFVfkE=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;\n b=fqMl6wrW79oxfyzoyYPmOZvgeh/upyt187L+wC0p4sZP55oF3Tmda1uf4rWfe5VuBwH4qRKuYExq1muccMxa0cmdjfjusGV0s1oimWJZNJDQXFTrqtYd08Yjv0QYtObnP08fkCfsr1OTi5iY0RFFJVYqk2113+f9wJ8irI2RPFk=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=WtbI2QDA; arc=none smtp.client-ip=10.30.226.201",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1774475201;\n\tbh=+ylu7bl+NpdgEU9QdSwkI5coZAZII7MT6smUgsFVfkE=;\n\th=From:Date:Subject:To:Cc:From;\n\tb=WtbI2QDAHRGy7hBuTjIP69MfxHOXAyGzvoMrNsp5XBNMRZ0XQDqzpD4vUBAxrCyga\n\t nlN6Pr3ryI8AZyTxfkNzMcJlhfL4rI0rE0drpazFPfDbXqBXKcAcxAkCKGkxIPr9+n\n\t 6L0SzBNgPMMWcJgsxIBRVgJiY1zNmtatn67QSRW6oCwtyMVuO2+3oF2je1hw3jIQwP\n\t NPGxGgaLR8cw6BkIIgyJUxbKOTmTTIyGbTvl15XuLsa6h8NoXay/TkactMoDeMnztm\n\t iRq3NB/u0fvu0v0FecAPfRgx2NkA5UQYWVTHYTLhUdsFakvQi+PDE52AvtI9+kuXzY\n\t pJ0aeyb1ow4cw==",
        "From": "Linus Walleij <linusw@kernel.org>",
        "Date": "Wed, 25 Mar 2026 22:46:36 +0100",
        "Subject": "[PATCH] RFT: x86_32: Move OLPC XO-1 audio GPIO to software nodes",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-gpio@vger.kernel.org",
        "List-Id": "<linux-gpio.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-gpio+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-gpio+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20260325-asoc-olpc-v1-1-ebe6de05c7e2@kernel.org>",
        "X-B4-Tracking": "v=1; b=H4sIAAAAAAAC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE\n vPSU3UzU4B8JSMDIzMDY0NL3cTi/GTd/JyCZN20NEPT5DRDSxMjgyQloPqCotS0zAqwWdGxtbU\n A1yljK1sAAAA=",
        "X-Change-ID": "20260319-asoc-olpc-ff15cf19420b",
        "To": "Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,\n Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,\n x86@kernel.org, \"H. Peter Anvin\" <hpa@zytor.com>,\n Jaya Kumar <jayakumar.alsa@gmail.com>, Jaroslav Kysela <perex@perex.cz>,\n Takashi Iwai <tiwai@suse.com>, Bartosz Golaszewski <brgl@kernel.org>",
        "Cc": "linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org,\n Linus Walleij <linusw@kernel.org>",
        "X-Mailer": "b4 0.14.3"
    },
    "content": "This needs real hardware to continue.\n\nAt the TODO spot, we need the name of the actual\nPCI device providing the cs5535 device.\n\nIf we can get this working, we can move over the rest\nof the hogs etc to software nodes and get rid of all\nthe custom cs5535_gpio_set(), cs5535_gpio_clear()\netc.\n\nIf it turns out that no-one is willing to actually\ntest OLPC XO-1 patches, I will follow up with a patch\nto just delete the XO-1 support altogether.\n\nSigned-off-by: Linus Walleij <linusw@kernel.org>\n---\n arch/x86/platform/olpc/olpc.c            | 33 ++++++++++++++++++++++++++++++++\n sound/pci/cs5535audio/cs5535audio.c      |  3 +--\n sound/pci/cs5535audio/cs5535audio.h      | 26 +++++++++++++------------\n sound/pci/cs5535audio/cs5535audio_olpc.c | 32 +++++++++++++++----------------\n sound/pci/cs5535audio/cs5535audio_pcm.c  |  4 ++--\n 5 files changed, 66 insertions(+), 32 deletions(-)\n\n\n---\nbase-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f\nchange-id: 20260319-asoc-olpc-ff15cf19420b\n\nBest regards,",
    "diff": "diff --git a/arch/x86/platform/olpc/olpc.c b/arch/x86/platform/olpc/olpc.c\nindex 1d4a00e767ec..95df7f691825 100644\n--- a/arch/x86/platform/olpc/olpc.c\n+++ b/arch/x86/platform/olpc/olpc.c\n@@ -10,6 +10,8 @@\n #include <linux/init.h>\n #include <linux/export.h>\n #include <linux/delay.h>\n+#include <linux/gpio/machine.h>\n+#include <linux/gpio/property.h>\n #include <linux/io.h>\n #include <linux/string.h>\n #include <linux/platform_device.h>\n@@ -17,6 +19,7 @@\n #include <linux/syscore_ops.h>\n #include <linux/mutex.h>\n #include <linux/olpc-ec.h>\n+#include <linux/property.h>\n \n #include <asm/geode.h>\n #include <asm/setup.h>\n@@ -283,6 +286,32 @@ static struct olpc_ec_driver ec_xo1_5_driver = {\n #endif\n };\n \n+/*\n+ * Create software nodes for GPIO look-ups so we can keep the\n+ * CS5535 GPIO driver abstract without peeking under the hood.\n+ */\n+static const struct software_node cs5535_gpiochip_node = {\n+\t.name = \"cs5535-gpio\",\n+};\n+\n+static const struct property_entry olpc_snd_props[] = {\n+\tPROPERTY_ENTRY_GPIO(\"mic-ac-gpios\", &cs5535_gpiochip_node,\n+\t\t\t    OLPC_GPIO_MIC_AC, GPIO_ACTIVE_HIGH),\n+\t{}\n+};\n+\n+static const struct software_node olpc_snd_node = {\n+\t/* TODO: dev_name(&pci->dev) for the OLPC CS5535 PCI device */\n+\t.name = \"\",\n+\t.properties = olpc_snd_props,\n+};\n+\n+static const struct software_node *olpc_sw_nodes[] = {\n+\t&cs5535_gpiochip_node,\n+\t&olpc_snd_node,\n+\tNULL\n+};\n+\n static int __init olpc_init(void)\n {\n \tint r = 0;\n@@ -315,6 +344,10 @@ static int __init olpc_init(void)\n \t\t\treturn r;\n \t}\n \n+\tr = software_node_register_node_group(olpc_sw_nodes);\n+\tif (r)\n+\t\treturn r;\n+\n \treturn 0;\n }\n \ndiff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c\nindex 0ebf6c02b1ef..676c540d03eb 100644\n--- a/sound/pci/cs5535audio/cs5535audio.c\n+++ b/sound/pci/cs5535audio/cs5535audio.c\n@@ -164,7 +164,7 @@ static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)\n \n \tsnd_ac97_tune_hardware(cs5535au->ac97, ac97_quirks, ac97_quirk);\n \n-\terr = olpc_quirks(card, cs5535au->ac97);\n+\terr = olpc_quirks(card, cs5535au);\n \tif (err < 0) {\n \t\tdev_err(card->dev, \"olpc quirks failed\\n\");\n \t\treturn err;\n@@ -241,7 +241,6 @@ static irqreturn_t snd_cs5535audio_interrupt(int irq, void *dev_id)\n \n static void snd_cs5535audio_free(struct snd_card *card)\n {\n-\tolpc_quirks_cleanup();\n }\n \n static int snd_cs5535audio_create(struct snd_card *card,\ndiff --git a/sound/pci/cs5535audio/cs5535audio.h b/sound/pci/cs5535audio/cs5535audio.h\nindex d84620a0c26c..f917fc21533a 100644\n--- a/sound/pci/cs5535audio/cs5535audio.h\n+++ b/sound/pci/cs5535audio/cs5535audio.h\n@@ -2,6 +2,8 @@\n #ifndef __SOUND_CS5535AUDIO_H\n #define __SOUND_CS5535AUDIO_H\n \n+#include <linux/gpio/consumer.h>\n+\n #define cs_writel(cs5535au, reg, val)\toutl(val, (cs5535au)->port + reg)\n #define cs_writeb(cs5535au, reg, val)\toutb(val, (cs5535au)->port + reg)\n #define cs_readl(cs5535au, reg)\t\tinl((cs5535au)->port + reg)\n@@ -93,6 +95,7 @@ struct cs5535audio {\n \tstruct snd_pcm_substream *playback_substream;\n \tstruct snd_pcm_substream *capture_substream;\n \tstruct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS];\n+\tstruct gpio_desc *mic_ac;\n };\n \n extern const struct dev_pm_ops snd_cs5535audio_pm;\n@@ -100,25 +103,24 @@ extern const struct dev_pm_ops snd_cs5535audio_pm;\n #ifdef CONFIG_OLPC\n void olpc_prequirks(struct snd_card *card,\n \t\t    struct snd_ac97_template *ac97);\n-int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97);\n-void olpc_quirks_cleanup(void);\n-void olpc_analog_input(struct snd_ac97 *ac97, int on);\n+int olpc_quirks(struct snd_card *card, struct cs5535audio *cs5535au);\n+void olpc_analog_input(struct cs5535audio *cs5535au, int on);\n void olpc_mic_bias(struct snd_ac97 *ac97, int on);\n \n-static inline void olpc_capture_open(struct snd_ac97 *ac97)\n+static inline void olpc_capture_open(struct cs5535audio *cs5535au)\n {\n \t/* default to Analog Input off */\n-\tolpc_analog_input(ac97, 0);\n+\tolpc_analog_input(cs5535au, 0);\n \t/* enable MIC Bias for recording */\n-\tolpc_mic_bias(ac97, 1);\n+\tolpc_mic_bias(cs5535au->ac97, 1);\n }\n \n-static inline void olpc_capture_close(struct snd_ac97 *ac97)\n+static inline void olpc_capture_close(struct cs5535audio *cs5535au)\n {\n \t/* disable Analog Input */\n-\tolpc_analog_input(ac97, 0);\n+\tolpc_analog_input(cs5535au, 0);\n \t/* disable the MIC Bias (so the recording LED turns off) */\n-\tolpc_mic_bias(ac97, 0);\n+\tolpc_mic_bias(cs5535au->ac97, 0);\n }\n #else\n static inline void olpc_prequirks(struct snd_card *card,\n@@ -128,10 +130,10 @@ static inline int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)\n \treturn 0;\n }\n static inline void olpc_quirks_cleanup(void) { }\n-static inline void olpc_analog_input(struct snd_ac97 *ac97, int on) { }\n+static inline void olpc_analog_input(struct cs5535audio *cs5535au, int on) { }\n static inline void olpc_mic_bias(struct snd_ac97 *ac97, int on) { }\n-static inline void olpc_capture_open(struct snd_ac97 *ac97) { }\n-static inline void olpc_capture_close(struct snd_ac97 *ac97) { }\n+static inline void olpc_capture_open(struct cs5535audio *cs5535au) { }\n+static inline void olpc_capture_close(struct cs5535audio *cs5535au) { }\n #endif\n \n int snd_cs5535audio_pcm(struct cs5535audio *cs5535audio);\ndiff --git a/sound/pci/cs5535audio/cs5535audio_olpc.c b/sound/pci/cs5535audio/cs5535audio_olpc.c\nindex 122170a410d9..19eed3c9c48b 100644\n--- a/sound/pci/cs5535audio/cs5535audio_olpc.c\n+++ b/sound/pci/cs5535audio/cs5535audio_olpc.c\n@@ -9,7 +9,7 @@\n #include <sound/info.h>\n #include <sound/control.h>\n #include <sound/ac97_codec.h>\n-#include <linux/gpio.h>\n+#include <linux/gpio/consumer.h>\n \n #include <asm/olpc.h>\n #include \"cs5535audio.h\"\n@@ -21,8 +21,9 @@\n  * It has an Analog Input mode that is switched into (after disabling the\n  * High Pass Filter) via GPIO.  It is supported on B2 and later models.\n  */\n-void olpc_analog_input(struct snd_ac97 *ac97, int on)\n+void olpc_analog_input(struct cs5535audio *cs5535au, int on)\n {\n+\tstruct snd_ac97 *ac97 = cs5535au->ac97;\n \tint err;\n \n \tif (!machine_is_olpc())\n@@ -38,7 +39,7 @@ void olpc_analog_input(struct snd_ac97 *ac97, int on)\n \t}\n \n \t/* set Analog Input through GPIO */\n-\tgpio_set_value(OLPC_GPIO_MIC_AC, on);\n+\tgpiod_set_value(cs5535au->mic_ac, on);\n }\n \n /*\n@@ -70,7 +71,9 @@ static int olpc_dc_info(struct snd_kcontrol *kctl,\n \n static int olpc_dc_get(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *v)\n {\n-\tv->value.integer.value[0] = gpio_get_value(OLPC_GPIO_MIC_AC);\n+\tstruct cs5535audio *cs5535au = snd_kcontrol_chip(kctl);\n+\n+\tv->value.integer.value[0] = gpiod_get_value(cs5535au->mic_ac);\n \treturn 0;\n }\n \n@@ -78,7 +81,7 @@ static int olpc_dc_put(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *v)\n {\n \tstruct cs5535audio *cs5535au = snd_kcontrol_chip(kctl);\n \n-\tolpc_analog_input(cs5535au->ac97, v->value.integer.value[0]);\n+\tolpc_analog_input(cs5535au, v->value.integer.value[0]);\n \treturn 1;\n }\n \n@@ -141,19 +144,22 @@ void olpc_prequirks(struct snd_card *card,\n \t\tac97->scaps |= AC97_SCAP_INV_EAPD;\n }\n \n-int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)\n+int olpc_quirks(struct snd_card *card, struct cs5535audio *cs5535au)\n {\n+\tstruct snd_ac97 *ac97 = cs5535au->ac97;\n \tstruct snd_ctl_elem_id elem;\n \tint i, err;\n \n \tif (!machine_is_olpc())\n \t\treturn 0;\n \n-\tif (gpio_request(OLPC_GPIO_MIC_AC, DRV_NAME)) {\n-\t\tdev_err(card->dev, \"unable to allocate MIC GPIO\\n\");\n-\t\treturn -EIO;\n+\tcs5535au->mic_ac = devm_gpiod_get_optional(card->dev, \"mic-ac\",\n+\t\t\t\t\t\t   GPIOD_OUT_LOW);\n+\tif (IS_ERR(cs5535au->mic_ac)) {\n+\t\tdev_err(card->dev, \"unable to allocate MIC AC GPIO\\n\");\n+\t\treturn PTR_ERR(cs5535au->mic_ac);\n \t}\n-\tgpio_direction_output(OLPC_GPIO_MIC_AC, 0);\n+\tgpiod_set_consumer_name(cs5535au->mic_ac, DRV_NAME);\n \n \t/* drop the original AD1888 HPF control */\n \tmemset(&elem, 0, sizeof(elem));\n@@ -179,9 +185,3 @@ int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)\n \tolpc_mic_bias(ac97, 0);\n \treturn 0;\n }\n-\n-void olpc_quirks_cleanup(void)\n-{\n-\tif (machine_is_olpc())\n-\t\tgpio_free(OLPC_GPIO_MIC_AC);\n-}\ndiff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c\nindex 48b99a07e3bc..49b1efb93dd9 100644\n--- a/sound/pci/cs5535audio/cs5535audio_pcm.c\n+++ b/sound/pci/cs5535audio/cs5535audio_pcm.c\n@@ -341,14 +341,14 @@ static int snd_cs5535audio_capture_open(struct snd_pcm_substream *substream)\n \t\t\t\t\t    SNDRV_PCM_HW_PARAM_PERIODS);\n \tif (err < 0)\n \t\treturn err;\n-\tolpc_capture_open(cs5535au->ac97);\n+\tolpc_capture_open(cs5535au);\n \treturn 0;\n }\n \n static int snd_cs5535audio_capture_close(struct snd_pcm_substream *substream)\n {\n \tstruct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);\n-\tolpc_capture_close(cs5535au->ac97);\n+\tolpc_capture_close(cs5535au);\n \treturn 0;\n }\n \n",
    "prefixes": []
}