hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/gpio/gpio-xtensa.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Copyright (C) 2013 TangoTec Ltd.
34 * Author: Baruch Siach <baruch@tkos.co.il>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
85 *
96 * Driver for the Xtensa LX4 GPIO32 Option
107 *
....@@ -30,7 +27,7 @@
3027
3128 #include <linux/err.h>
3229 #include <linux/module.h>
33
-#include <linux/gpio.h>
30
+#include <linux/gpio/driver.h>
3431 #include <linux/bitops.h>
3532 #include <linux/platform_device.h>
3633
....@@ -47,15 +44,14 @@
4744 unsigned long flags;
4845
4946 local_irq_save(flags);
50
- RSR_CPENABLE(*cpenable);
51
- WSR_CPENABLE(*cpenable | BIT(XCHAL_CP_ID_XTIOP));
52
-
47
+ *cpenable = xtensa_get_sr(cpenable);
48
+ xtensa_set_sr(*cpenable | BIT(XCHAL_CP_ID_XTIOP), cpenable);
5349 return flags;
5450 }
5551
5652 static inline void disable_cp(unsigned long flags, unsigned long cpenable)
5753 {
58
- WSR_CPENABLE(cpenable);
54
+ xtensa_set_sr(cpenable, cpenable);
5955 local_irq_restore(flags);
6056 }
6157
....@@ -75,7 +71,7 @@
7571
7672 static int xtensa_impwire_get_direction(struct gpio_chip *gc, unsigned offset)
7773 {
78
- return 1; /* input only */
74
+ return GPIO_LINE_DIRECTION_IN; /* input only */
7975 }
8076
8177 static int xtensa_impwire_get_value(struct gpio_chip *gc, unsigned offset)
....@@ -98,7 +94,7 @@
9894
9995 static int xtensa_expstate_get_direction(struct gpio_chip *gc, unsigned offset)
10096 {
101
- return 0; /* output only */
97
+ return GPIO_LINE_DIRECTION_OUT; /* output only */
10298 }
10399
104100 static int xtensa_expstate_get_value(struct gpio_chip *gc, unsigned offset)