| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * I2C Link Layer for Samsung S3FWRN5 NCI based Driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2015 Samsung Electrnoics |
|---|
| 5 | 6 | * Robert Baldyga <r.baldyga@samsung.com> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 8 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 9 | | - * version 2 or later, as published by the Free Software Foundation. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | | - * You should have received a copy of the GNU General Public License |
|---|
| 17 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
|---|
| 18 | 7 | */ |
|---|
| 19 | 8 | |
|---|
| 20 | 9 | #include <linux/i2c.h> |
|---|
| .. | .. |
|---|
| 175 | 164 | static irqreturn_t s3fwrn5_i2c_irq_thread_fn(int irq, void *phy_id) |
|---|
| 176 | 165 | { |
|---|
| 177 | 166 | struct s3fwrn5_i2c_phy *phy = phy_id; |
|---|
| 178 | | - int ret = 0; |
|---|
| 179 | 167 | |
|---|
| 180 | 168 | if (!phy || !phy->ndev) { |
|---|
| 181 | 169 | WARN_ON_ONCE(1); |
|---|
| .. | .. |
|---|
| 190 | 178 | switch (phy->mode) { |
|---|
| 191 | 179 | case S3FWRN5_MODE_NCI: |
|---|
| 192 | 180 | case S3FWRN5_MODE_FW: |
|---|
| 193 | | - ret = s3fwrn5_i2c_read(phy); |
|---|
| 181 | + s3fwrn5_i2c_read(phy); |
|---|
| 194 | 182 | break; |
|---|
| 195 | 183 | case S3FWRN5_MODE_COLD: |
|---|
| 196 | | - ret = -EREMOTEIO; |
|---|
| 197 | 184 | break; |
|---|
| 198 | 185 | } |
|---|
| 199 | 186 | |
|---|
| .. | .. |
|---|
| 211 | 198 | if (!np) |
|---|
| 212 | 199 | return -ENODEV; |
|---|
| 213 | 200 | |
|---|
| 214 | | - phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0); |
|---|
| 215 | | - if (!gpio_is_valid(phy->gpio_en)) |
|---|
| 216 | | - return -ENODEV; |
|---|
| 201 | + phy->gpio_en = of_get_named_gpio(np, "en-gpios", 0); |
|---|
| 202 | + if (!gpio_is_valid(phy->gpio_en)) { |
|---|
| 203 | + /* Support also deprecated property */ |
|---|
| 204 | + phy->gpio_en = of_get_named_gpio(np, "s3fwrn5,en-gpios", 0); |
|---|
| 205 | + if (!gpio_is_valid(phy->gpio_en)) |
|---|
| 206 | + return -ENODEV; |
|---|
| 207 | + } |
|---|
| 217 | 208 | |
|---|
| 218 | | - phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0); |
|---|
| 219 | | - if (!gpio_is_valid(phy->gpio_fw_wake)) |
|---|
| 220 | | - return -ENODEV; |
|---|
| 209 | + phy->gpio_fw_wake = of_get_named_gpio(np, "wake-gpios", 0); |
|---|
| 210 | + if (!gpio_is_valid(phy->gpio_fw_wake)) { |
|---|
| 211 | + /* Support also deprecated property */ |
|---|
| 212 | + phy->gpio_fw_wake = of_get_named_gpio(np, "s3fwrn5,fw-gpios", 0); |
|---|
| 213 | + if (!gpio_is_valid(phy->gpio_fw_wake)) |
|---|
| 214 | + return -ENODEV; |
|---|
| 215 | + } |
|---|
| 221 | 216 | |
|---|
| 222 | 217 | return 0; |
|---|
| 223 | 218 | } |
|---|
| .. | .. |
|---|
| 290 | 285 | |
|---|
| 291 | 286 | static struct i2c_driver s3fwrn5_i2c_driver = { |
|---|
| 292 | 287 | .driver = { |
|---|
| 293 | | - .owner = THIS_MODULE, |
|---|
| 294 | 288 | .name = S3FWRN5_I2C_DRIVER_NAME, |
|---|
| 295 | 289 | .of_match_table = of_match_ptr(of_s3fwrn5_i2c_match), |
|---|
| 296 | 290 | }, |
|---|