aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorBongsu Jeon <bongsu.jeon@samsung.com>2020-12-08 23:10:12 +0900
committerDavid S. Miller <davem@davemloft.net>2020-12-09 16:49:46 -0800
commit237410fb83538407646109063c4d902c42261387 (patch)
tree349fda61a31540b0b78be645dbe8472bcdcaa5d7 /drivers/nfc
parentdt-bindings: net: nfc: s3fwrn5: Change I2C interrupt trigger type (diff)
downloadlinux-dev-237410fb83538407646109063c4d902c42261387.tar.xz
linux-dev-237410fb83538407646109063c4d902c42261387.zip
nfc: s3fwrn5: Remove hard coded interrupt trigger type from the i2c module
For the flexible control of interrupt trigger type, remove the hard coded interrupt trigger type in the i2c module. The trigger type will be loaded from a dts. Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/s3fwrn5/i2c.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c
index e1bdde105f24..42f1f610ac2c 100644
--- a/drivers/nfc/s3fwrn5/i2c.c
+++ b/drivers/nfc/s3fwrn5/i2c.c
@@ -179,6 +179,8 @@ static int s3fwrn5_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct s3fwrn5_i2c_phy *phy;
+ struct irq_data *irq_data;
+ unsigned long irqflags;
int ret;
phy = devm_kzalloc(&client->dev, sizeof(*phy), GFP_KERNEL);
@@ -212,8 +214,11 @@ static int s3fwrn5_i2c_probe(struct i2c_client *client,
if (ret < 0)
return ret;
+ irq_data = irq_get_irq_data(client->irq);
+ irqflags = irqd_get_trigger_type(irq_data) | IRQF_ONESHOT;
+
ret = devm_request_threaded_irq(&client->dev, phy->i2c_dev->irq, NULL,
- s3fwrn5_i2c_irq_thread_fn, IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
+ s3fwrn5_i2c_irq_thread_fn, irqflags,
S3FWRN5_I2C_DRIVER_NAME, phy);
if (ret)
s3fwrn5_remove(phy->common.ndev);