2019-05-31 01:09:57 -07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2014-05-25 13:35:38 -07:00
|
|
|
/*
|
2015-06-09 13:26:05 -07:00
|
|
|
* I2C Link Layer for ST NCI NFC controller familly based Driver
|
|
|
|
* Copyright (C) 2014-2015 STMicroelectronics SAS. All rights reserved.
|
2014-05-25 13:35:38 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/i2c.h>
|
nfc: st-nci: Add support for acpi probing for i2c device.
Add support for acpi probing.
SMO2101 is used for st21nfcb
SMO2102 is used for st21nfcc
It has been tested with the following acpi node on Minnowboard:
Note: Remove uicc-present or ese-present Package if one them is not
supported.
Device (NFC1)
{
Name (_ADR, Zero) // _ADR: Address
Name (_HID, "SMO2101") // _HID: Hardware ID
Name (_CID, "SMO2101") // _CID: Compatible ID
Name (_DDN, "SMO NFC") // _DDN: DOS Device Name
Name (_UID, One) // _UID: Unique ID
Name (_DSD, Package (0x02)
{
/* Device Properties for _DSD */
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package (0x02)
{
Package (0x02) { "uicc-present", 1 },
Package (0x02) { "ese-present", 1 }
}
})
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Name (SBUF, ResourceTemplate ()
{
I2cSerialBus (0x0008, ControllerInitiated, 400000,
AddressingMode7Bit, "\\_SB.I2C7",
0x00, ResourceConsumer, ,)
GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullNone, 0x0000,
"\\_SB.GPO2", 0x00, ResourceConsumer, ,)
{ // Pin list
0x0001
}
GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
"\\_SB.GPO2", 0x00, ResourceConsumer, ,)
{ // Pin list
0x0002,
}
})
Return (SBUF) /* \_SB_.I2C7.NFC1._CRS.SBUF */
}
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
}
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-12-23 15:45:09 -07:00
|
|
|
#include <linux/gpio/consumer.h>
|
|
|
|
#include <linux/acpi.h>
|
2014-05-25 13:35:38 -07:00
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/nfc.h>
|
2017-06-19 03:08:54 -07:00
|
|
|
#include <linux/of.h>
|
2014-05-25 13:35:38 -07:00
|
|
|
|
2015-10-25 14:54:17 -07:00
|
|
|
#include "st-nci.h"
|
2014-05-25 13:35:38 -07:00
|
|
|
|
2015-08-14 13:33:31 -07:00
|
|
|
#define DRIVER_DESC "NCI NFC driver for ST_NCI"
|
2014-05-25 13:35:38 -07:00
|
|
|
|
|
|
|
/* ndlc header */
|
2015-10-25 14:54:44 -07:00
|
|
|
#define ST_NCI_FRAME_HEADROOM 1
|
2015-08-14 13:33:31 -07:00
|
|
|
#define ST_NCI_FRAME_TAILROOM 0
|
2014-05-25 13:35:38 -07:00
|
|
|
|
2015-06-09 13:26:05 -07:00
|
|
|
#define ST_NCI_I2C_MIN_SIZE 4 /* PCB(1) + NCI Packet header(3) */
|
|
|
|
#define ST_NCI_I2C_MAX_SIZE 250 /* req 4.2.1 */
|
2014-05-25 13:35:38 -07:00
|
|
|
|
2017-06-19 03:08:52 -07:00
|
|
|
#define ST_NCI_DRIVER_NAME "st_nci"
|
2015-06-09 13:26:05 -07:00
|
|
|
#define ST_NCI_I2C_DRIVER_NAME "st_nci_i2c"
|
2014-05-25 13:35:38 -07:00
|
|
|
|
2015-06-09 13:26:05 -07:00
|
|
|
struct st_nci_i2c_phy {
|
2014-05-25 13:35:38 -07:00
|
|
|
struct i2c_client *i2c_dev;
|
|
|
|
struct llt_ndlc *ndlc;
|
|
|
|
|
2015-10-25 14:54:48 -07:00
|
|
|
bool irq_active;
|
|
|
|
|
2017-06-19 03:08:54 -07:00
|
|
|
struct gpio_desc *gpiod_reset;
|
2015-10-25 14:54:39 -07:00
|
|
|
|
|
|
|
struct st_nci_se_status se_status;
|
2014-05-25 13:35:38 -07:00
|
|
|
};
|
|
|
|
|
2015-06-09 13:26:05 -07:00
|
|
|
static int st_nci_i2c_enable(void *phy_id)
|
2014-05-25 13:35:38 -07:00
|
|
|
{
|
2015-06-09 13:26:05 -07:00
|
|
|
struct st_nci_i2c_phy *phy = phy_id;
|
2014-05-25 13:35:38 -07:00
|
|
|
|
2017-06-19 03:08:54 -07:00
|
|
|
gpiod_set_value(phy->gpiod_reset, 0);
|
2014-05-25 13:35:38 -07:00
|
|
|
usleep_range(10000, 15000);
|
2017-06-19 03:08:54 -07:00
|
|
|
gpiod_set_value(phy->gpiod_reset, 1);
|
2014-05-25 13:35:38 -07:00
|
|
|
usleep_range(80000, 85000);
|
|
|
|
|
2015-10-25 14:54:48 -07:00
|
|
|
if (phy->ndlc->powered == 0 && phy->irq_active == 0) {
|
2015-06-06 04:16:51 -07:00
|
|
|
enable_irq(phy->i2c_dev->irq);
|
2015-10-25 14:54:48 -07:00
|
|
|
phy->irq_active = true;
|
|
|
|
}
|
2015-06-06 04:16:51 -07:00
|
|
|
|
2014-05-25 13:35:38 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-09 13:26:05 -07:00
|
|
|
static void st_nci_i2c_disable(void *phy_id)
|
2014-05-25 13:35:38 -07:00
|
|
|
{
|
2015-06-09 13:26:05 -07:00
|
|
|
struct st_nci_i2c_phy *phy = phy_id;
|
2014-05-25 13:35:38 -07:00
|
|
|
|
2015-06-06 04:16:51 -07:00
|
|
|
disable_irq_nosync(phy->i2c_dev->irq);
|
2015-10-25 14:54:48 -07:00
|
|
|
phy->irq_active = false;
|
2014-05-25 13:35:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Writing a frame must not return the number of written bytes.
|
|
|
|
* It must return either zero for success, or <0 for error.
|
|
|
|
* In addition, it must not alter the skb
|
|
|
|
*/
|
2015-06-09 13:26:05 -07:00
|
|
|
static int st_nci_i2c_write(void *phy_id, struct sk_buff *skb)
|
2014-05-25 13:35:38 -07:00
|
|
|
{
|
2019-07-02 06:16:42 -07:00
|
|
|
int r;
|
2015-06-09 13:26:05 -07:00
|
|
|
struct st_nci_i2c_phy *phy = phy_id;
|
2014-05-25 13:35:38 -07:00
|
|
|
struct i2c_client *client = phy->i2c_dev;
|
|
|
|
|
2014-09-13 01:28:47 -07:00
|
|
|
if (phy->ndlc->hard_fault != 0)
|
|
|
|
return phy->ndlc->hard_fault;
|
2014-05-25 13:35:38 -07:00
|
|
|
|
|
|
|
r = i2c_master_send(client, skb->data, skb->len);
|
2015-03-30 23:02:15 -07:00
|
|
|
if (r < 0) { /* Retry, chip was in standby */
|
2014-05-25 13:35:38 -07:00
|
|
|
usleep_range(1000, 4000);
|
|
|
|
r = i2c_master_send(client, skb->data, skb->len);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (r >= 0) {
|
|
|
|
if (r != skb->len)
|
|
|
|
r = -EREMOTEIO;
|
|
|
|
else
|
|
|
|
r = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Reads an ndlc frame and returns it in a newly allocated sk_buff.
|
|
|
|
* returns:
|
2015-08-14 13:33:32 -07:00
|
|
|
* 0 : if received frame is complete
|
2014-05-25 13:35:38 -07:00
|
|
|
* -EREMOTEIO : i2c read error (fatal)
|
|
|
|
* -EBADMSG : frame was incorrect and discarded
|
2015-08-14 13:33:32 -07:00
|
|
|
* -ENOMEM : cannot allocate skb, frame dropped
|
2014-05-25 13:35:38 -07:00
|
|
|
*/
|
2015-06-09 13:26:05 -07:00
|
|
|
static int st_nci_i2c_read(struct st_nci_i2c_phy *phy,
|
2014-05-25 13:35:38 -07:00
|
|
|
struct sk_buff **skb)
|
|
|
|
{
|
|
|
|
int r;
|
|
|
|
u8 len;
|
2015-06-09 13:26:05 -07:00
|
|
|
u8 buf[ST_NCI_I2C_MAX_SIZE];
|
2014-05-25 13:35:38 -07:00
|
|
|
struct i2c_client *client = phy->i2c_dev;
|
|
|
|
|
2015-06-09 13:26:05 -07:00
|
|
|
r = i2c_master_recv(client, buf, ST_NCI_I2C_MIN_SIZE);
|
2015-03-30 23:02:15 -07:00
|
|
|
if (r < 0) { /* Retry, chip was in standby */
|
2014-05-25 13:35:38 -07:00
|
|
|
usleep_range(1000, 4000);
|
2015-06-09 13:26:05 -07:00
|
|
|
r = i2c_master_recv(client, buf, ST_NCI_I2C_MIN_SIZE);
|
2014-09-03 14:30:26 -07:00
|
|
|
}
|
|
|
|
|
2015-06-09 13:26:05 -07:00
|
|
|
if (r != ST_NCI_I2C_MIN_SIZE)
|
2014-05-25 13:35:38 -07:00
|
|
|
return -EREMOTEIO;
|
|
|
|
|
|
|
|
len = be16_to_cpu(*(__be16 *) (buf + 2));
|
2015-06-09 13:26:05 -07:00
|
|
|
if (len > ST_NCI_I2C_MAX_SIZE) {
|
2014-05-25 13:35:38 -07:00
|
|
|
nfc_err(&client->dev, "invalid frame len\n");
|
|
|
|
return -EBADMSG;
|
|
|
|
}
|
|
|
|
|
2015-06-09 13:26:05 -07:00
|
|
|
*skb = alloc_skb(ST_NCI_I2C_MIN_SIZE + len, GFP_KERNEL);
|
2014-05-25 13:35:38 -07:00
|
|
|
if (*skb == NULL)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2015-06-09 13:26:05 -07:00
|
|
|
skb_reserve(*skb, ST_NCI_I2C_MIN_SIZE);
|
|
|
|
skb_put(*skb, ST_NCI_I2C_MIN_SIZE);
|
|
|
|
memcpy((*skb)->data, buf, ST_NCI_I2C_MIN_SIZE);
|
2014-05-25 13:35:38 -07:00
|
|
|
|
|
|
|
if (!len)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
r = i2c_master_recv(client, buf, len);
|
|
|
|
if (r != len) {
|
|
|
|
kfree_skb(*skb);
|
|
|
|
return -EREMOTEIO;
|
|
|
|
}
|
|
|
|
|
|
|
|
skb_put(*skb, len);
|
2015-06-09 13:26:05 -07:00
|
|
|
memcpy((*skb)->data + ST_NCI_I2C_MIN_SIZE, buf, len);
|
2014-05-25 13:35:38 -07:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Reads an ndlc frame from the chip.
|
|
|
|
*
|
2015-08-14 13:33:31 -07:00
|
|
|
* On ST_NCI, IRQ goes in idle state when read starts.
|
2014-05-25 13:35:38 -07:00
|
|
|
*/
|
2015-06-09 13:26:05 -07:00
|
|
|
static irqreturn_t st_nci_irq_thread_fn(int irq, void *phy_id)
|
2014-05-25 13:35:38 -07:00
|
|
|
{
|
2015-06-09 13:26:05 -07:00
|
|
|
struct st_nci_i2c_phy *phy = phy_id;
|
2014-05-25 13:35:38 -07:00
|
|
|
struct sk_buff *skb = NULL;
|
|
|
|
int r;
|
|
|
|
|
2015-01-25 15:33:29 -07:00
|
|
|
if (!phy || !phy->ndlc || irq != phy->i2c_dev->irq) {
|
2014-05-25 13:35:38 -07:00
|
|
|
WARN_ON_ONCE(1);
|
|
|
|
return IRQ_NONE;
|
|
|
|
}
|
|
|
|
|
2014-09-13 01:28:47 -07:00
|
|
|
if (phy->ndlc->hard_fault)
|
2014-05-25 13:35:38 -07:00
|
|
|
return IRQ_HANDLED;
|
|
|
|
|
2015-06-06 04:16:50 -07:00
|
|
|
if (!phy->ndlc->powered) {
|
2015-06-09 13:26:05 -07:00
|
|
|
st_nci_i2c_disable(phy);
|
2014-05-25 13:35:38 -07:00
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
|
|
|
|
2015-06-09 13:26:05 -07:00
|
|
|
r = st_nci_i2c_read(phy, &skb);
|
2014-09-13 01:28:47 -07:00
|
|
|
if (r == -EREMOTEIO || r == -ENOMEM || r == -EBADMSG)
|
2014-05-25 13:35:38 -07:00
|
|
|
return IRQ_HANDLED;
|
|
|
|
|
|
|
|
ndlc_recv(phy->ndlc, skb);
|
|
|
|
|
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
|
|
|
|
2021-07-24 14:47:36 -07:00
|
|
|
static const struct nfc_phy_ops i2c_phy_ops = {
|
2015-06-09 13:26:05 -07:00
|
|
|
.write = st_nci_i2c_write,
|
|
|
|
.enable = st_nci_i2c_enable,
|
|
|
|
.disable = st_nci_i2c_disable,
|
2014-05-25 13:35:38 -07:00
|
|
|
};
|
|
|
|
|
2017-06-19 03:08:56 -07:00
|
|
|
static const struct acpi_gpio_params reset_gpios = { 1, 0, false };
|
|
|
|
|
|
|
|
static const struct acpi_gpio_mapping acpi_st_nci_gpios[] = {
|
|
|
|
{ "reset-gpios", &reset_gpios, 1 },
|
|
|
|
{},
|
|
|
|
};
|
|
|
|
|
2022-11-22 21:55:06 -07:00
|
|
|
static int st_nci_i2c_probe(struct i2c_client *client)
|
2014-05-25 13:35:38 -07:00
|
|
|
{
|
2017-06-19 03:08:55 -07:00
|
|
|
struct device *dev = &client->dev;
|
2015-06-09 13:26:05 -07:00
|
|
|
struct st_nci_i2c_phy *phy;
|
2014-05-25 13:35:38 -07:00
|
|
|
int r;
|
|
|
|
|
|
|
|
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
|
|
|
|
nfc_err(&client->dev, "Need I2C_FUNC_I2C\n");
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
2017-06-19 03:08:57 -07:00
|
|
|
phy = devm_kzalloc(dev, sizeof(struct st_nci_i2c_phy), GFP_KERNEL);
|
2015-04-07 00:17:00 -07:00
|
|
|
if (!phy)
|
2014-05-25 13:35:38 -07:00
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
phy->i2c_dev = client;
|
|
|
|
|
|
|
|
i2c_set_clientdata(client, phy);
|
|
|
|
|
2017-06-19 03:08:57 -07:00
|
|
|
r = devm_acpi_dev_add_driver_gpios(dev, acpi_st_nci_gpios);
|
|
|
|
if (r)
|
|
|
|
dev_dbg(dev, "Unable to add GPIO mapping table\n");
|
|
|
|
|
|
|
|
/* Get RESET GPIO */
|
|
|
|
phy->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
|
|
|
|
if (IS_ERR(phy->gpiod_reset)) {
|
|
|
|
nfc_err(dev, "Unable to get RESET GPIO\n");
|
2014-05-25 13:35:38 -07:00
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
2017-06-19 03:08:55 -07:00
|
|
|
phy->se_status.is_ese_present =
|
|
|
|
device_property_read_bool(dev, "ese-present");
|
|
|
|
phy->se_status.is_uicc_present =
|
|
|
|
device_property_read_bool(dev, "uicc-present");
|
|
|
|
|
2015-01-25 15:33:29 -07:00
|
|
|
r = ndlc_probe(phy, &i2c_phy_ops, &client->dev,
|
2015-08-14 13:33:31 -07:00
|
|
|
ST_NCI_FRAME_HEADROOM, ST_NCI_FRAME_TAILROOM,
|
2015-10-25 14:54:39 -07:00
|
|
|
&phy->ndlc, &phy->se_status);
|
2015-01-25 15:33:29 -07:00
|
|
|
if (r < 0) {
|
|
|
|
nfc_err(&client->dev, "Unable to register ndlc layer\n");
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
2015-10-25 14:54:48 -07:00
|
|
|
phy->irq_active = true;
|
2014-05-25 13:35:38 -07:00
|
|
|
r = devm_request_threaded_irq(&client->dev, client->irq, NULL,
|
2015-06-09 13:26:05 -07:00
|
|
|
st_nci_irq_thread_fn,
|
2017-06-19 03:08:53 -07:00
|
|
|
IRQF_ONESHOT,
|
2015-06-09 13:26:05 -07:00
|
|
|
ST_NCI_DRIVER_NAME, phy);
|
2015-01-25 15:33:29 -07:00
|
|
|
if (r < 0)
|
2014-05-25 13:35:38 -07:00
|
|
|
nfc_err(&client->dev, "Unable to register IRQ handler\n");
|
|
|
|
|
2015-01-25 15:33:29 -07:00
|
|
|
return r;
|
2014-05-25 13:35:38 -07:00
|
|
|
}
|
|
|
|
|
2022-08-15 01:02:30 -07:00
|
|
|
static void st_nci_i2c_remove(struct i2c_client *client)
|
2014-05-25 13:35:38 -07:00
|
|
|
{
|
2015-06-09 13:26:05 -07:00
|
|
|
struct st_nci_i2c_phy *phy = i2c_get_clientdata(client);
|
2014-05-25 13:35:38 -07:00
|
|
|
|
|
|
|
ndlc_remove(phy->ndlc);
|
|
|
|
}
|
|
|
|
|
2017-08-21 10:03:59 -07:00
|
|
|
static const struct i2c_device_id st_nci_i2c_id_table[] = {
|
2024-06-19 12:56:31 -07:00
|
|
|
{ ST_NCI_DRIVER_NAME },
|
2015-12-23 15:45:05 -07:00
|
|
|
{}
|
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(i2c, st_nci_i2c_id_table);
|
|
|
|
|
2021-05-28 05:41:58 -07:00
|
|
|
static const struct acpi_device_id st_nci_i2c_acpi_match[] __maybe_unused = {
|
nfc: st-nci: Add support for acpi probing for i2c device.
Add support for acpi probing.
SMO2101 is used for st21nfcb
SMO2102 is used for st21nfcc
It has been tested with the following acpi node on Minnowboard:
Note: Remove uicc-present or ese-present Package if one them is not
supported.
Device (NFC1)
{
Name (_ADR, Zero) // _ADR: Address
Name (_HID, "SMO2101") // _HID: Hardware ID
Name (_CID, "SMO2101") // _CID: Compatible ID
Name (_DDN, "SMO NFC") // _DDN: DOS Device Name
Name (_UID, One) // _UID: Unique ID
Name (_DSD, Package (0x02)
{
/* Device Properties for _DSD */
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package (0x02)
{
Package (0x02) { "uicc-present", 1 },
Package (0x02) { "ese-present", 1 }
}
})
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Name (SBUF, ResourceTemplate ()
{
I2cSerialBus (0x0008, ControllerInitiated, 400000,
AddressingMode7Bit, "\\_SB.I2C7",
0x00, ResourceConsumer, ,)
GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullNone, 0x0000,
"\\_SB.GPO2", 0x00, ResourceConsumer, ,)
{ // Pin list
0x0001
}
GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
"\\_SB.GPO2", 0x00, ResourceConsumer, ,)
{ // Pin list
0x0002,
}
})
Return (SBUF) /* \_SB_.I2C7.NFC1._CRS.SBUF */
}
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
}
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-12-23 15:45:09 -07:00
|
|
|
{"SMO2101"},
|
|
|
|
{"SMO2102"},
|
|
|
|
{}
|
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(acpi, st_nci_i2c_acpi_match);
|
|
|
|
|
2021-05-28 05:41:58 -07:00
|
|
|
static const struct of_device_id of_st_nci_i2c_match[] __maybe_unused = {
|
2014-12-08 14:08:07 -07:00
|
|
|
{ .compatible = "st,st21nfcb-i2c", },
|
2014-05-25 13:35:38 -07:00
|
|
|
{ .compatible = "st,st21nfcb_i2c", },
|
2015-06-09 13:26:05 -07:00
|
|
|
{ .compatible = "st,st21nfcc-i2c", },
|
2014-05-25 13:35:38 -07:00
|
|
|
{}
|
|
|
|
};
|
2015-06-09 13:26:05 -07:00
|
|
|
MODULE_DEVICE_TABLE(of, of_st_nci_i2c_match);
|
2014-05-25 13:35:38 -07:00
|
|
|
|
2015-06-09 13:26:05 -07:00
|
|
|
static struct i2c_driver st_nci_i2c_driver = {
|
2014-05-25 13:35:38 -07:00
|
|
|
.driver = {
|
2015-06-09 13:26:05 -07:00
|
|
|
.name = ST_NCI_I2C_DRIVER_NAME,
|
|
|
|
.of_match_table = of_match_ptr(of_st_nci_i2c_match),
|
nfc: st-nci: Add support for acpi probing for i2c device.
Add support for acpi probing.
SMO2101 is used for st21nfcb
SMO2102 is used for st21nfcc
It has been tested with the following acpi node on Minnowboard:
Note: Remove uicc-present or ese-present Package if one them is not
supported.
Device (NFC1)
{
Name (_ADR, Zero) // _ADR: Address
Name (_HID, "SMO2101") // _HID: Hardware ID
Name (_CID, "SMO2101") // _CID: Compatible ID
Name (_DDN, "SMO NFC") // _DDN: DOS Device Name
Name (_UID, One) // _UID: Unique ID
Name (_DSD, Package (0x02)
{
/* Device Properties for _DSD */
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package (0x02)
{
Package (0x02) { "uicc-present", 1 },
Package (0x02) { "ese-present", 1 }
}
})
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Name (SBUF, ResourceTemplate ()
{
I2cSerialBus (0x0008, ControllerInitiated, 400000,
AddressingMode7Bit, "\\_SB.I2C7",
0x00, ResourceConsumer, ,)
GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullNone, 0x0000,
"\\_SB.GPO2", 0x00, ResourceConsumer, ,)
{ // Pin list
0x0001
}
GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
"\\_SB.GPO2", 0x00, ResourceConsumer, ,)
{ // Pin list
0x0002,
}
})
Return (SBUF) /* \_SB_.I2C7.NFC1._CRS.SBUF */
}
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
}
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2015-12-23 15:45:09 -07:00
|
|
|
.acpi_match_table = ACPI_PTR(st_nci_i2c_acpi_match),
|
2014-05-25 13:35:38 -07:00
|
|
|
},
|
2023-05-20 10:21:04 -07:00
|
|
|
.probe = st_nci_i2c_probe,
|
2015-06-09 13:26:05 -07:00
|
|
|
.id_table = st_nci_i2c_id_table,
|
|
|
|
.remove = st_nci_i2c_remove,
|
2014-05-25 13:35:38 -07:00
|
|
|
};
|
2015-06-09 13:26:05 -07:00
|
|
|
module_i2c_driver(st_nci_i2c_driver);
|
2014-05-25 13:35:38 -07:00
|
|
|
|
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
MODULE_DESCRIPTION(DRIVER_DESC);
|