Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Miao Wang via B4 Relay <devnull+shankerwangmiao.gmail.com@kernel.org>
To: Yinbo Zhu <zhuyinbo@loongson.cn>,
	Linus Walleij <linusw@kernel.org>,
	 Bartosz Golaszewski <brgl@kernel.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-gpio@vger.kernel.org,
	 Miao Wang <shankerwangmiao@gmail.com>
Subject: [PATCH RFC 4/4] gpio: loongson-64bit: remove gpio_to_irq() handler
Date: Sat, 26 Sep 2026 00:28:39 +0800	[thread overview]
Message-ID: <20260926-loongsongpio-v1-4-71de7ebebb76@gmail.com> (raw)
In-Reply-To: <20260926-loongsongpio-v1-0-71de7ebebb76@gmail.com>

From: Miao Wang <shankerwangmiao@gmail.com>

As pointed out in the previous commit, gpio_to_irq() should not be used
because it should not be used to manipulate the registers to enable
interrupts.

Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
---
 drivers/gpio/gpio-loongson-64bit.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/gpio/gpio-loongson-64bit.c b/drivers/gpio/gpio-loongson-64bit.c
index 6e5687dcb413c247fb0d76c596c445f94efccd01..d24eb52ef13ce386437c422e290f1b0ea4e6672b 100644
--- a/drivers/gpio/gpio-loongson-64bit.c
+++ b/drivers/gpio/gpio-loongson-64bit.c
@@ -141,24 +141,6 @@ static int loongson_gpio_set(struct gpio_chip *chip, unsigned int pin, int value
 	return 0;
 }
 
-static int loongson_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
-{
-	unsigned int u;
-	struct platform_device *pdev = to_platform_device(chip->parent);
-	struct loongson_gpio_chip *lgpio = to_loongson_gpio_chip(chip);
-
-	if (lgpio->chip_data->mode == BIT_CTRL_MODE) {
-		/* Get the register index from offset then multiply by bytes per register */
-		u = readl(lgpio->reg_base + lgpio->chip_data->inten_offset + (offset / 32) * 4);
-		u |= BIT(offset % 32);
-		writel(u, lgpio->reg_base + lgpio->chip_data->inten_offset + (offset / 32) * 4);
-	} else {
-		writeb(1, lgpio->reg_base + lgpio->chip_data->inten_offset + offset);
-	}
-
-	return platform_get_irq(pdev, offset);
-}
-
 static void loongson_gpio_irq_ack(struct irq_data *data)
 {
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
@@ -945,8 +927,6 @@ static int loongson_gpio_init(struct platform_device *pdev, struct loongson_gpio
 			dev_warn(&pdev->dev, "no parent IRQs ha been found, GPIO IRQs will not be available\n");
 			gpio_irq_chip_set_chip(&lgpio->chip.gc.irq, NULL);
 		}
-	} else if (lgpio->chip_data->inten_offset) {
-		lgpio->chip.gc.to_irq = loongson_gpio_to_irq;
 	}
 
 	return devm_gpiochip_add_data(&pdev->dev, &lgpio->chip.gc, lgpio);

-- 
2.55.0



  parent reply	other threads:[~2026-09-25 16:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 16:28 [PATCH RFC 0/4] gpio: loongson-64bit: add interrupt support for more models Miao Wang via B4 Relay
2026-09-25 16:28 ` [PATCH RFC 1/4] gpio: loongson-64bit: Support for irq controller on 2k2000 and 7a2000 Miao Wang via B4 Relay
2026-09-25 16:28 ` [PATCH RFC 2/4] gpio: loongson-64bit: Generalize interrupt controller initialization Miao Wang via B4 Relay
2026-09-25 16:28 ` [PATCH RFC 3/4] gpio: loongson-64bit: Add shared interrupt support Miao Wang via B4 Relay
2026-10-01  8:33   ` Linus Walleij
2026-10-01  8:59     ` Miao Wang
2026-10-01 11:54       ` Linus Walleij
2026-10-01 17:47       ` Miao Wang
2026-10-01 19:43         ` Linus Walleij
2026-10-02  4:03           ` Miao Wang
2026-09-25 16:28 ` Miao Wang via B4 Relay [this message]
2026-09-29 13:01 ` [PATCH RFC 0/4] gpio: loongson-64bit: add interrupt support for more models Bartosz Golaszewski
2026-09-29 13:18   ` Miao Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260926-loongsongpio-v1-4-71de7ebebb76@gmail.com \
    --to=devnull+shankerwangmiao.gmail.com@kernel.org \
    --cc=brgl@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=shankerwangmiao@gmail.com \
    --cc=zhuyinbo@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox