Commit e2f0f671 authored by Mark Greer's avatar Mark Greer Committed by Samuel Ortiz

NFC: trf7970a: Clean up coding style issues

Clean up coding style issues according to scripts/Lindent.
Some scripts/Lindent changes were reverted when it appeared
to make the code less readable or when it made the line run
over 80 characters.
Signed-off-by: default avatarMark Greer <mgreer@animalcreek.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent d34e48d6
...@@ -126,7 +126,6 @@ ...@@ -126,7 +126,6 @@
#define TRF7970A_13MHZ_CLOCK_FREQUENCY 13560000 #define TRF7970A_13MHZ_CLOCK_FREQUENCY 13560000
#define TRF7970A_27MHZ_CLOCK_FREQUENCY 27120000 #define TRF7970A_27MHZ_CLOCK_FREQUENCY 27120000
#define TRF7970A_RX_SKB_ALLOC_SIZE 256 #define TRF7970A_RX_SKB_ALLOC_SIZE 256
#define TRF7970A_FIFO_SIZE 127 #define TRF7970A_FIFO_SIZE 127
...@@ -459,7 +458,6 @@ struct trf7970a { ...@@ -459,7 +458,6 @@ struct trf7970a {
struct delayed_work timeout_work; struct delayed_work timeout_work;
}; };
static int trf7970a_cmd(struct trf7970a *trf, u8 opcode) static int trf7970a_cmd(struct trf7970a *trf, u8 opcode)
{ {
u8 cmd = TRF7970A_CMD_BIT_CTRL | TRF7970A_CMD_BIT_OPCODE(opcode); u8 cmd = TRF7970A_CMD_BIT_CTRL | TRF7970A_CMD_BIT_OPCODE(opcode);
...@@ -489,7 +487,8 @@ static int trf7970a_read(struct trf7970a *trf, u8 reg, u8 *val) ...@@ -489,7 +487,8 @@ static int trf7970a_read(struct trf7970a *trf, u8 reg, u8 *val)
return ret; return ret;
} }
static int trf7970a_read_cont(struct trf7970a *trf, u8 reg, u8 *buf, size_t len) static int trf7970a_read_cont(struct trf7970a *trf, u8 reg, u8 *buf,
size_t len)
{ {
u8 addr = reg | TRF7970A_CMD_BIT_RW | TRF7970A_CMD_BIT_CONTINUOUS; u8 addr = reg | TRF7970A_CMD_BIT_RW | TRF7970A_CMD_BIT_CONTINUOUS;
struct spi_transfer t[2]; struct spi_transfer t[2];
...@@ -656,7 +655,8 @@ static void trf7970a_send_err_upstream(struct trf7970a *trf, int errno) ...@@ -656,7 +655,8 @@ static void trf7970a_send_err_upstream(struct trf7970a *trf, int errno)
} }
static int trf7970a_transmit(struct trf7970a *trf, struct sk_buff *skb, static int trf7970a_transmit(struct trf7970a *trf, struct sk_buff *skb,
unsigned int len, u8 *prefix, unsigned int prefix_len) unsigned int len, u8 *prefix,
unsigned int prefix_len)
{ {
struct spi_transfer t[2]; struct spi_transfer t[2];
struct spi_message m; struct spi_message m;
...@@ -794,8 +794,7 @@ static void trf7970a_drain_fifo(struct trf7970a *trf, u8 status) ...@@ -794,8 +794,7 @@ static void trf7970a_drain_fifo(struct trf7970a *trf, u8 status)
/* If received Type 2 ACK/NACK, shift right 4 bits and pass up */ /* If received Type 2 ACK/NACK, shift right 4 bits and pass up */
if ((trf->framing == NFC_DIGITAL_FRAMING_NFCA_T2T) && (skb->len == 1) && if ((trf->framing == NFC_DIGITAL_FRAMING_NFCA_T2T) && (skb->len == 1) &&
(trf->special_fcn_reg1 == (trf->special_fcn_reg1 == TRF7970A_SPECIAL_FCN_REG1_4_BIT_RX)) {
TRF7970A_SPECIAL_FCN_REG1_4_BIT_RX)) {
skb->data[0] >>= 4; skb->data[0] >>= 4;
status = TRF7970A_IRQ_STATUS_SRX; status = TRF7970A_IRQ_STATUS_SRX;
} else { } else {
...@@ -904,8 +903,8 @@ static irqreturn_t trf7970a_irq(int irq, void *dev_id) ...@@ -904,8 +903,8 @@ static irqreturn_t trf7970a_irq(int irq, void *dev_id)
trf7970a_cmd(trf, TRF7970A_CMD_FIFO_RESET); trf7970a_cmd(trf, TRF7970A_CMD_FIFO_RESET);
if (!trf->timeout) { if (!trf->timeout) {
trf->ignore_timeout = !cancel_delayed_work( trf->ignore_timeout =
&trf->timeout_work); !cancel_delayed_work(&trf->timeout_work);
trf->rx_skb = ERR_PTR(0); trf->rx_skb = ERR_PTR(0);
trf7970a_send_upstream(trf); trf7970a_send_upstream(trf);
break; break;
...@@ -1245,7 +1244,8 @@ static int trf7970a_is_rf_field(struct trf7970a *trf, bool *is_rf_field) ...@@ -1245,7 +1244,8 @@ static int trf7970a_is_rf_field(struct trf7970a *trf, bool *is_rf_field)
u8 rssi; u8 rssi;
ret = trf7970a_write(trf, TRF7970A_CHIP_STATUS_CTRL, ret = trf7970a_write(trf, TRF7970A_CHIP_STATUS_CTRL,
trf->chip_status_ctrl | TRF7970A_CHIP_STATUS_REC_ON); trf->chip_status_ctrl |
TRF7970A_CHIP_STATUS_REC_ON);
if (ret) if (ret)
return ret; return ret;
...@@ -1586,8 +1586,7 @@ static int trf7970a_tg_config_rf_tech(struct trf7970a *trf, int tech) ...@@ -1586,8 +1586,7 @@ static int trf7970a_tg_config_rf_tech(struct trf7970a *trf, int tech)
switch (tech) { switch (tech) {
case NFC_DIGITAL_RF_TECH_106A: case NFC_DIGITAL_RF_TECH_106A:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_NFC_NFC_CE_MODE | trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_NFC_NFC_CE_MODE |
TRF7970A_ISO_CTRL_NFC_CE | TRF7970A_ISO_CTRL_NFC_CE | TRF7970A_ISO_CTRL_NFC_CE_14443A;
TRF7970A_ISO_CTRL_NFC_CE_14443A;
trf->modulator_sys_clk_ctrl = trf->modulator_sys_clk_ctrl =
(trf->modulator_sys_clk_ctrl & 0xf8) | (trf->modulator_sys_clk_ctrl & 0xf8) |
TRF7970A_MODULATOR_DEPTH_OOK; TRF7970A_MODULATOR_DEPTH_OOK;
...@@ -1733,7 +1732,8 @@ static int trf7970a_tg_configure_hw(struct nfc_digital_dev *ddev, int type, ...@@ -1733,7 +1732,8 @@ static int trf7970a_tg_configure_hw(struct nfc_digital_dev *ddev, int type,
} }
static int _trf7970a_tg_listen(struct nfc_digital_dev *ddev, u16 timeout, static int _trf7970a_tg_listen(struct nfc_digital_dev *ddev, u16 timeout,
nfc_digital_cmd_complete_t cb, void *arg, bool mode_detect) nfc_digital_cmd_complete_t cb, void *arg,
bool mode_detect)
{ {
struct trf7970a *trf = nfc_digital_get_drvdata(ddev); struct trf7970a *trf = nfc_digital_get_drvdata(ddev);
int ret; int ret;
...@@ -1818,7 +1818,8 @@ static int trf7970a_tg_listen(struct nfc_digital_dev *ddev, u16 timeout, ...@@ -1818,7 +1818,8 @@ static int trf7970a_tg_listen(struct nfc_digital_dev *ddev, u16 timeout,
} }
static int trf7970a_tg_listen_md(struct nfc_digital_dev *ddev, static int trf7970a_tg_listen_md(struct nfc_digital_dev *ddev,
u16 timeout, nfc_digital_cmd_complete_t cb, void *arg) u16 timeout, nfc_digital_cmd_complete_t cb,
void *arg)
{ {
struct trf7970a *trf = nfc_digital_get_drvdata(ddev); struct trf7970a *trf = nfc_digital_get_drvdata(ddev);
int ret; int ret;
...@@ -1939,8 +1940,7 @@ static int trf7970a_power_down(struct trf7970a *trf) ...@@ -1939,8 +1940,7 @@ static int trf7970a_power_down(struct trf7970a *trf)
gpiod_set_value_cansleep(trf->en_gpiod, 0); gpiod_set_value_cansleep(trf->en_gpiod, 0);
if (trf->en2_gpiod && if (trf->en2_gpiod && !(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW))
!(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW))
gpiod_set_value_cansleep(trf->en2_gpiod, 0); gpiod_set_value_cansleep(trf->en2_gpiod, 0);
ret = regulator_disable(trf->regulator); ret = regulator_disable(trf->regulator);
...@@ -2062,13 +2062,13 @@ static int trf7970a_probe(struct spi_device *spi) ...@@ -2062,13 +2062,13 @@ static int trf7970a_probe(struct spi_device *spi)
if ((clk_freq != TRF7970A_27MHZ_CLOCK_FREQUENCY) || if ((clk_freq != TRF7970A_27MHZ_CLOCK_FREQUENCY) ||
(clk_freq != TRF7970A_13MHZ_CLOCK_FREQUENCY)) { (clk_freq != TRF7970A_13MHZ_CLOCK_FREQUENCY)) {
dev_err(trf->dev, dev_err(trf->dev,
"clock-frequency (%u Hz) unsupported\n", "clock-frequency (%u Hz) unsupported\n", clk_freq);
clk_freq);
return -EINVAL; return -EINVAL;
} }
ret = devm_request_threaded_irq(trf->dev, spi->irq, NULL, ret = devm_request_threaded_irq(trf->dev, spi->irq, NULL,
trf7970a_irq, IRQF_TRIGGER_RISING | IRQF_ONESHOT, trf7970a_irq,
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
"trf7970a", trf); "trf7970a", trf);
if (ret) { if (ret) {
dev_err(trf->dev, "Can't request IRQ#%d: %d\n", spi->irq, ret); dev_err(trf->dev, "Can't request IRQ#%d: %d\n", spi->irq, ret);
...@@ -2116,7 +2116,8 @@ static int trf7970a_probe(struct spi_device *spi) ...@@ -2116,7 +2116,8 @@ static int trf7970a_probe(struct spi_device *spi)
trf->ddev = nfc_digital_allocate_device(&trf7970a_nfc_ops, trf->ddev = nfc_digital_allocate_device(&trf7970a_nfc_ops,
TRF7970A_SUPPORTED_PROTOCOLS, TRF7970A_SUPPORTED_PROTOCOLS,
NFC_DIGITAL_DRV_CAPS_IN_CRC | NFC_DIGITAL_DRV_CAPS_IN_CRC |
NFC_DIGITAL_DRV_CAPS_TG_CRC, 0, 0); NFC_DIGITAL_DRV_CAPS_TG_CRC, 0,
0);
if (!trf->ddev) { if (!trf->ddev) {
dev_err(trf->dev, "Can't allocate NFC digital device\n"); dev_err(trf->dev, "Can't allocate NFC digital device\n");
ret = -ENOMEM; ret = -ENOMEM;
...@@ -2252,15 +2253,17 @@ static const struct dev_pm_ops trf7970a_pm_ops = { ...@@ -2252,15 +2253,17 @@ static const struct dev_pm_ops trf7970a_pm_ops = {
}; };
static const struct of_device_id trf7970a_of_match[] = { static const struct of_device_id trf7970a_of_match[] = {
{ .compatible = "ti,trf7970a", }, {.compatible = "ti,trf7970a",},
{}, {},
}; };
MODULE_DEVICE_TABLE(of, trf7970a_of_match); MODULE_DEVICE_TABLE(of, trf7970a_of_match);
static const struct spi_device_id trf7970a_id_table[] = { static const struct spi_device_id trf7970a_id_table[] = {
{ "trf7970a", 0 }, {"trf7970a", 0},
{ } {}
}; };
MODULE_DEVICE_TABLE(spi, trf7970a_id_table); MODULE_DEVICE_TABLE(spi, trf7970a_id_table);
static struct spi_driver trf7970a_spi_driver = { static struct spi_driver trf7970a_spi_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment