Commit a5ec171e authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartosz Golaszewski
Browse files

gpio: Remove unused and obsoleted irq_to_gpio()



irq_to_gpio() is legacy and unused API, remove it for good.

This leaves gpio_to_irq() as it's used yet in many places.
Nevertheless, removal of its counterpart is a good signal
to whoever even trying to consider using them that do not.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 029d14e9
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -387,9 +387,6 @@ map between them using calls like::
	/* map GPIO numbers to IRQ numbers */
	int gpio_to_irq(unsigned gpio);

	/* map IRQ numbers to GPIO numbers (avoid using this) */
	int irq_to_gpio(unsigned irq);

Those return either the corresponding number in the other namespace, or
else a negative errno code if the mapping can't be done.  (For example,
some GPIOs can't be used as IRQs.)  It is an unchecked error to use a GPIO
@@ -405,11 +402,6 @@ devices, by the board-specific initialization code. Note that IRQ trigger
options are part of the IRQ interface, e.g. IRQF_TRIGGER_FALLING, as are
system wakeup capabilities.

Non-error values returned from irq_to_gpio() would most commonly be used
with gpio_get_value(), for example to initialize or update driver state
when the IRQ is edge-triggered.  Note that some platforms don't support
this reverse mapping, so you should avoid using it.


Emulating Open Drain Signals
----------------------------
+0 −7
Original line number Diff line number Diff line
@@ -358,9 +358,6 @@ GPIO 编号是无符号整数;IRQ 编号也是。这些构成了两个逻辑上
	/* 映射 GPIO 编号到 IRQ 编号 */
	int gpio_to_irq(unsigned gpio);

	/* 映射 IRQ 编号到 GPIO 编号 (尽量避免使用) */
	int irq_to_gpio(unsigned irq);

它们的返回值为对应命名空间的相关编号,或是负的错误代码(如果无法映射)。
(例如,某些 GPIO 无法做为 IRQ 使用。)以下的编号错误是未经检测的:使用一个
未通过 gpio_direction_input()配置为输入的 GPIO 编号,或者使用一个
@@ -373,10 +370,6 @@ gpio_to_irq()返回的非错误值可以传递给 request_irq()或者 free_irq()
触发选项是 IRQ 接口的一部分,如 IRQF_TRIGGER_FALLING,系统唤醒能力
也是如此。

irq_to_gpio()返回的非错误值大多数通常可以被 gpio_get_value()所使用,
比如在 IRQ 是沿触发时初始化或更新驱动状态。注意某些平台不支持反映射,所以
你应该尽量避免使用它。


模拟开漏信号
------------
+0 −7
Original line number Diff line number Diff line
@@ -363,9 +363,6 @@ GPIO 編號是無符號整數;IRQ 編號也是。這些構成了兩個邏輯上
	/* 映射 GPIO 編號到 IRQ 編號 */
	int gpio_to_irq(unsigned gpio);

	/* 映射 IRQ 編號到 GPIO 編號 (儘量避免使用) */
	int irq_to_gpio(unsigned irq);

它們的返回值爲對應命名空間的相關編號,或是負的錯誤代碼(如果無法映射)。
(例如,某些 GPIO 無法做爲 IRQ 使用。)以下的編號錯誤是未經檢測的:使用一個
未通過 gpio_direction_input()配置爲輸入的 GPIO 編號,或者使用一個
@@ -378,10 +375,6 @@ gpio_to_irq()返回的非錯誤值可以傳遞給 request_irq()或者 free_irq()
觸發選項是 IRQ 接口的一部分,如 IRQF_TRIGGER_FALLING,系統喚醒能力
也是如此。

irq_to_gpio()返回的非錯誤值大多數通常可以被 gpio_get_value()所使用,
比如在 IRQ 是沿觸發時初始化或更新驅動狀態。注意某些平台不支持反映射,所以
你應該儘量避免使用它。


模擬開漏信號
----------------------------
+0 −7
Original line number Diff line number Diff line
@@ -66,13 +66,6 @@ static inline int gpio_to_irq(unsigned gpio)
		return __gpio_to_irq(gpio);
}

static inline int irq_to_gpio(unsigned irq)
{
	return (irq >= MCFGPIO_IRQ_VECBASE &&
		irq < (MCFGPIO_IRQ_VECBASE + MCFGPIO_IRQ_MAX)) ?
		irq - MCFGPIO_IRQ_VECBASE : -ENXIO;
}

static inline int gpio_cansleep(unsigned gpio)
{
	return gpio < MCFGPIO_PIN_MAX ? 0 : __gpio_cansleep(gpio);
+0 −5
Original line number Diff line number Diff line
@@ -40,11 +40,6 @@ static inline int gpio_to_irq(unsigned gpio)
	return __gpio_to_irq(gpio);
}

static inline int irq_to_gpio(unsigned int irq)
{
	return -ENOSYS;
}

#endif /* CONFIG_GPIOLIB */

#endif /* __ASM_SH_GPIO_H */
Loading