This 3rd NFC pull request for 3.9 contains a fix for the microread MEI

physical layer support, as the MEI bus API changed.
 
 From the MEI code, we now pass the MEI id back to the driver probe routine,
 and we also pass a name and a MEI id table through the mei_bus_driver
 structure. A few renames as well like e.g. mei_bus_driver to mei_driver or
 mei_bus_client to mei_device in order to be closer to the driver model
 practices.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRGSzIAAoJEIqAPN1PVmxKMvQP+wVGB2rGrkSl4yDkH3GUiByA
 52+PlWsiYQPZ8vMUWzZbdSeDr8tvg0SfJuQV1OBH+Z0h0mKW5EtgvVBKYcT760H2
 pwSKidQj6OjdUJMmneJMCeiSduK5BUi4Ij86EAXxGiNHWuON4g+oYOumwE8uXznG
 LRL5q3DaHksaKzARapy5duhj6QFP3vMGzDge+DDx4BCJALzG8LU+hB/Op3NdgqO4
 WrK3wCIb0xmZLM1ZmQv/pfGU7TELzaMUhRSzI5g6HvDU9ikRkbftu0uxEnHmtPuX
 h7kQpTBZsQ35qXNH5YsLvXf8my2Ru6ix4+3YCX2dBnHsLfVmdEhZPX81D5Pbj8qT
 ph2Rz21UgnEQ2ZpOys3vWAA0geVWmkTKvQwDJAaRn6e/mYzV1Rji4Ujoqj8RQfqf
 2AoRPhT468jznFNkMfoAy5YQvi+BV+HXmyd64rMBSrMd2MXvL677JSNAFK2SBN7l
 Ki8Y3AmA/LLxW7/cptMlD0ILhWLzzETiVKCKOargQpSncaEYlG9L8iSshQKo8LWF
 7F1+7tjquYVKgIGpvMVfooO1xPCI0QXeFxtH1riwDnAqzyMkc22FOg4PTXz9WcPx
 gIosvAmu3mQ81NskWFzll+gBVD2+5hctEJA8nTa6PB9/Gdf+vTjDbO9Hjx9HAIzT
 gWFk/JUShDwEMK3ybnh4
 =PtZa
 -----END PGP SIGNATURE-----

Merge tag 'nfc-next-3.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next

Samuel Ortiz <sameo@linux.intel.com> says:

"This 3rd NFC pull request for 3.9 contains a fix for the microread MEI
physical layer support, as the MEI bus API changed.

From the MEI code, we now pass the MEI id back to the driver probe routine,
and we also pass a name and a MEI id table through the mei_bus_driver
structure. A few renames as well like e.g. mei_bus_driver to mei_driver or
mei_bus_client to mei_device in order to be closer to the driver model
practices."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
John W. Linville 2013-02-11 15:30:47 -05:00
commit 5d8eac3ad9
1 changed files with 24 additions and 19 deletions

View File

@ -48,7 +48,7 @@ struct mei_nfc_hdr {
#define MEI_NFC_MAX_READ (MEI_NFC_HEADER_SIZE + MEI_NFC_MAX_HCI_PAYLOAD)
struct microread_mei_phy {
struct mei_bus_client *client;
struct mei_device *mei_device;
struct nfc_hci_dev *hdev;
int powered;
@ -105,14 +105,14 @@ static int microread_mei_write(void *phy_id, struct sk_buff *skb)
MEI_DUMP_SKB_OUT("mei frame sent", skb);
r = mei_bus_send(phy->client, skb->data, skb->len);
r = mei_send(phy->device, skb->data, skb->len);
if (r > 0)
r = 0;
return r;
}
static void microread_event_cb(struct mei_bus_client *client, u32 events,
static void microread_event_cb(struct mei_device *device, u32 events,
void *context)
{
struct microread_mei_phy *phy = context;
@ -120,7 +120,7 @@ static void microread_event_cb(struct mei_bus_client *client, u32 events,
if (phy->hard_fault != 0)
return;
if (events & BIT(MEI_BUS_EVENT_RX)) {
if (events & BIT(MEI_EVENT_RX)) {
struct sk_buff *skb;
int reply_size;
@ -128,7 +128,7 @@ static void microread_event_cb(struct mei_bus_client *client, u32 events,
if (!skb)
return;
reply_size = mei_bus_recv(client, skb->data, MEI_NFC_MAX_READ);
reply_size = mei_recv(device, skb->data, MEI_NFC_MAX_READ);
if (reply_size < MEI_NFC_HEADER_SIZE) {
kfree(skb);
return;
@ -149,7 +149,8 @@ static struct nfc_phy_ops mei_phy_ops = {
.disable = microread_mei_disable,
};
static int microread_mei_probe(struct mei_bus_client *client)
static int microread_mei_probe(struct mei_device *device,
const struct mei_id *id)
{
struct microread_mei_phy *phy;
int r;
@ -162,10 +163,10 @@ static int microread_mei_probe(struct mei_bus_client *client)
return -ENOMEM;
}
phy->client = client;
mei_bus_set_clientdata(client, phy);
phy->device = device;
mei_set_clientdata(device, phy);
r = mei_bus_register_event_cb(client, microread_event_cb, phy);
r = mei_register_event_cb(device, microread_event_cb, phy);
if (r) {
pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n");
goto err_out;
@ -185,9 +186,9 @@ err_out:
return r;
}
static int microread_mei_remove(struct mei_bus_client *client)
static int microread_mei_remove(struct mei_device *device)
{
struct microread_mei_phy *phy = mei_bus_get_clientdata(client);
struct microread_mei_phy *phy = mei_get_clientdata(device);
pr_info("Removing microread\n");
@ -201,14 +202,18 @@ static int microread_mei_remove(struct mei_bus_client *client)
return 0;
}
static struct mei_bus_driver microread_driver = {
.driver = {
.name = MICROREAD_DRIVER_NAME,
},
.id = {
.name = MICROREAD_DRIVER_NAME,
.uuid = MICROREAD_UUID,
},
static struct mei_id microread_mei_tbl[] = {
{ MICROREAD_DRIVER_NAME, MICROREAD_UUID },
/* required last entry */
{ }
};
MODULE_DEVICE_TABLE(mei, microread_mei_tbl);
static struct mei_driver microread_driver = {
.id_table = microread_mei_tbl,
.name = MICROREAD_DRIVER_NAME,
.probe = microread_mei_probe,
.remove = microread_mei_remove,