hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/dsa/mv88e6xxx/global2_scratch.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Marvell 88E6xxx Switch Global 2 Scratch & Misc Registers support
34 *
....@@ -5,11 +6,6 @@
56 *
67 * Copyright (c) 2017 National Instruments
78 * Brandon Streiff <brandon.streiff@ni.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
139 */
1410
1511 #include "chip.h"
....@@ -41,13 +37,15 @@
4137 {
4238 u16 value = (reg << 8) | data;
4339
44
- return mv88e6xxx_g2_update(chip, MV88E6XXX_G2_SCRATCH_MISC_MISC, value);
40
+ return mv88e6xxx_g2_write(chip, MV88E6XXX_G2_SCRATCH_MISC_MISC,
41
+ MV88E6XXX_G2_SCRATCH_MISC_UPDATE | value);
4542 }
4643
4744 /**
4845 * mv88e6xxx_g2_scratch_gpio_get_bit - get a bit
4946 * @chip: chip private data
50
- * @nr: bit index
47
+ * @base_reg: base of scratch bits
48
+ * @offset: index of bit within the register
5149 * @set: is bit set?
5250 */
5351 static int mv88e6xxx_g2_scratch_get_bit(struct mv88e6xxx_chip *chip,
....@@ -71,8 +69,9 @@
7169 /**
7270 * mv88e6xxx_g2_scratch_gpio_set_bit - set (or clear) a bit
7371 * @chip: chip private data
74
- * @nr: bit index
75
- * @set: set if true, clear if false
72
+ * @base_reg: base of scratch bits
73
+ * @offset: index of bit within the register
74
+ * @set: should this bit be set?
7675 *
7776 * Helper function for dealing with the direction and data registers.
7877 */
....@@ -168,6 +167,7 @@
168167 * mv88e6352_g2_scratch_gpio_set_dir - set direction of gpio pin
169168 * @chip: chip private data
170169 * @pin: gpio index
170
+ * @input: should the gpio be an input, or an output?
171171 */
172172 static int mv88e6352_g2_scratch_gpio_set_dir(struct mv88e6xxx_chip *chip,
173173 unsigned int pin, bool input)