.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * twl4030.h - header for TWL4030 PM and audio CODEC device |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Based on tlv320aic23.c: |
---|
7 | 8 | * Copyright (c) by Kai Svahn <kai.svahn@nokia.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 | | - * |
---|
14 | | - * This program is distributed in the hope that it will be useful, |
---|
15 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | | - * GNU General Public License for more details. |
---|
18 | | - * |
---|
19 | | - * You should have received a copy of the GNU General Public License |
---|
20 | | - * along with this program; if not, write to the Free Software |
---|
21 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
22 | | - * |
---|
23 | 9 | */ |
---|
24 | 10 | |
---|
25 | 11 | #ifndef __TWL_H_ |
---|
.. | .. |
---|
195 | 181 | } |
---|
196 | 182 | |
---|
197 | 183 | static inline int twl_i2c_write_u16(u8 mod_no, u16 val, u8 reg) { |
---|
198 | | - val = cpu_to_le16(val); |
---|
199 | | - return twl_i2c_write(mod_no, (u8*) &val, reg, 2); |
---|
| 184 | + __le16 value; |
---|
| 185 | + |
---|
| 186 | + value = cpu_to_le16(val); |
---|
| 187 | + return twl_i2c_write(mod_no, (u8 *) &value, reg, 2); |
---|
200 | 188 | } |
---|
201 | 189 | |
---|
202 | 190 | static inline int twl_i2c_read_u16(u8 mod_no, u16 *val, u8 reg) { |
---|
203 | 191 | int ret; |
---|
204 | | - ret = twl_i2c_read(mod_no, (u8*) val, reg, 2); |
---|
205 | | - *val = le16_to_cpu(*val); |
---|
| 192 | + __le16 value; |
---|
| 193 | + |
---|
| 194 | + ret = twl_i2c_read(mod_no, (u8 *) &value, reg, 2); |
---|
| 195 | + *val = le16_to_cpu(value); |
---|
206 | 196 | return ret; |
---|
207 | 197 | } |
---|
208 | 198 | |
---|