.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Marvell 88E6xxx Switch Global 2 Scratch & Misc Registers support |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (c) 2017 National Instruments |
---|
7 | 8 | * 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. |
---|
13 | 9 | */ |
---|
14 | 10 | |
---|
15 | 11 | #include "chip.h" |
---|
.. | .. |
---|
41 | 37 | { |
---|
42 | 38 | u16 value = (reg << 8) | data; |
---|
43 | 39 | |
---|
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); |
---|
45 | 42 | } |
---|
46 | 43 | |
---|
47 | 44 | /** |
---|
48 | 45 | * mv88e6xxx_g2_scratch_gpio_get_bit - get a bit |
---|
49 | 46 | * @chip: chip private data |
---|
50 | | - * @nr: bit index |
---|
| 47 | + * @base_reg: base of scratch bits |
---|
| 48 | + * @offset: index of bit within the register |
---|
51 | 49 | * @set: is bit set? |
---|
52 | 50 | */ |
---|
53 | 51 | static int mv88e6xxx_g2_scratch_get_bit(struct mv88e6xxx_chip *chip, |
---|
.. | .. |
---|
71 | 69 | /** |
---|
72 | 70 | * mv88e6xxx_g2_scratch_gpio_set_bit - set (or clear) a bit |
---|
73 | 71 | * @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? |
---|
76 | 75 | * |
---|
77 | 76 | * Helper function for dealing with the direction and data registers. |
---|
78 | 77 | */ |
---|
.. | .. |
---|
168 | 167 | * mv88e6352_g2_scratch_gpio_set_dir - set direction of gpio pin |
---|
169 | 168 | * @chip: chip private data |
---|
170 | 169 | * @pin: gpio index |
---|
| 170 | + * @input: should the gpio be an input, or an output? |
---|
171 | 171 | */ |
---|
172 | 172 | static int mv88e6352_g2_scratch_gpio_set_dir(struct mv88e6xxx_chip *chip, |
---|
173 | 173 | unsigned int pin, bool input) |
---|