Skip to content

Commit edaea3d

Browse files
author
Jiri Kosina
committed
Merge branch 'for-5.1/ish' into for-linus
Power management improvements from Song Hongyan Switch to new UUID API from Andy Shevchenko Generalization the driver bindin to support more than just sensors from Srinivas Pandruvada
2 parents 487b6d0 + 1578461 commit edaea3d

File tree

8 files changed

+26
-26
lines changed

8 files changed

+26
-26
lines changed

drivers/hid/intel-ish-hid/ipc/ipc.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ static bool check_generated_interrupt(struct ishtp_device *dev)
9191
IPC_INT_FROM_ISH_TO_HOST_CHV_AB(pisr_val);
9292
} else {
9393
pisr_val = ish_reg_read(dev, IPC_REG_PISR_BXT);
94-
interrupt_generated = IPC_INT_FROM_ISH_TO_HOST_BXT(pisr_val);
94+
interrupt_generated = !!pisr_val;
95+
/* only busy-clear bit is RW, others are RO */
96+
if (pisr_val)
97+
ish_reg_write(dev, IPC_REG_PISR_BXT, pisr_val);
9598
}
9699

97100
return interrupt_generated;
@@ -839,11 +842,11 @@ int ish_hw_start(struct ishtp_device *dev)
839842
{
840843
ish_set_host_rdy(dev);
841844

845+
set_host_ready(dev);
846+
842847
/* After that we can enable ISH DMA operation and wakeup ISHFW */
843848
ish_wakeup(dev);
844849

845-
set_host_ready(dev);
846-
847850
/* wait for FW-initiated reset flow */
848851
if (!dev->recvd_hw_ready)
849852
wait_event_interruptible_timeout(dev->wait_hw_ready,

drivers/hid/intel-ish-hid/ishtp-hid-client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,8 @@ static int hid_ishtp_cl_probe(struct ishtp_cl_device *cl_device)
788788
if (!cl_device)
789789
return -ENODEV;
790790

791-
if (uuid_le_cmp(hid_ishtp_guid,
792-
cl_device->fw_client->props.protocol_name) != 0)
791+
if (!guid_equal(&hid_ishtp_guid,
792+
&cl_device->fw_client->props.protocol_name))
793793
return -ENODEV;
794794

795795
client_data = devm_kzalloc(&cl_device->dev, sizeof(*client_data),

drivers/hid/intel-ish-hid/ishtp-hid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
206206
hid->bus = BUS_INTEL_ISHTP;
207207
hid->dev.parent = &client_data->cl_device->dev;
208208
hid->version = le16_to_cpu(ISH_HID_VERSION);
209-
hid->vendor = le16_to_cpu(ISH_HID_VENDOR);
210-
hid->product = le16_to_cpu(ISH_HID_PRODUCT);
209+
hid->vendor = le16_to_cpu(client_data->hid_devices[cur_hid_dev].vid);
210+
hid->product = le16_to_cpu(client_data->hid_devices[cur_hid_dev].pid);
211211
snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "hid-ishtp",
212212
hid->vendor, hid->product);
213213

drivers/hid/intel-ish-hid/ishtp-hid.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
client->cl_device->ishtp_dev, __VA_ARGS__)
3030

3131
/* ISH Transport protocol (ISHTP in short) GUID */
32-
static const uuid_le hid_ishtp_guid = UUID_LE(0x33AECD58, 0xB679, 0x4E54,
33-
0x9B, 0xD9, 0xA0, 0x4D, 0x34,
34-
0xF0, 0xC2, 0x26);
32+
static const guid_t hid_ishtp_guid =
33+
GUID_INIT(0x33AECD58, 0xB679, 0x4E54,
34+
0x9B, 0xD9, 0xA0, 0x4D, 0x34, 0xF0, 0xC2, 0x26);
3535

3636
/* ISH HID message structure */
3737
struct hostif_msg_hdr {

drivers/hid/intel-ish-hid/ishtp/bus.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,15 @@ int ishtp_write_message(struct ishtp_device *dev, struct ishtp_msg_hdr *hdr,
133133
*
134134
* Return: fw client index or -ENOENT if not found
135135
*/
136-
int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const uuid_le *uuid)
136+
int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const guid_t *uuid)
137137
{
138-
int i, res = -ENOENT;
138+
unsigned int i;
139139

140140
for (i = 0; i < dev->fw_clients_num; ++i) {
141-
if (uuid_le_cmp(*uuid, dev->fw_clients[i].props.protocol_name)
142-
== 0) {
143-
res = i;
144-
break;
145-
}
141+
if (guid_equal(uuid, &dev->fw_clients[i].props.protocol_name))
142+
return i;
146143
}
147-
return res;
144+
return -ENOENT;
148145
}
149146
EXPORT_SYMBOL(ishtp_fw_cl_by_uuid);
150147

@@ -158,7 +155,7 @@ EXPORT_SYMBOL(ishtp_fw_cl_by_uuid);
158155
* Return: pointer of client information on success, NULL on failure.
159156
*/
160157
struct ishtp_fw_client *ishtp_fw_cl_get_client(struct ishtp_device *dev,
161-
const uuid_le *uuid)
158+
const guid_t *uuid)
162159
{
163160
int i;
164161
unsigned long flags;
@@ -401,7 +398,7 @@ static const struct device_type ishtp_cl_device_type = {
401398
* Return: ishtp_cl_device pointer or NULL on failure
402399
*/
403400
static struct ishtp_cl_device *ishtp_bus_add_device(struct ishtp_device *dev,
404-
uuid_le uuid, char *name)
401+
guid_t uuid, char *name)
405402
{
406403
struct ishtp_cl_device *device;
407404
int status;
@@ -629,7 +626,7 @@ int ishtp_bus_new_client(struct ishtp_device *dev)
629626
int i;
630627
char *dev_name;
631628
struct ishtp_cl_device *cl_device;
632-
uuid_le device_uuid;
629+
guid_t device_uuid;
633630

634631
/*
635632
* For all reported clients, create an unconnected client and add its
@@ -639,7 +636,7 @@ int ishtp_bus_new_client(struct ishtp_device *dev)
639636
*/
640637
i = dev->fw_client_presentation_num - 1;
641638
device_uuid = dev->fw_clients[i].props.protocol_name;
642-
dev_name = kasprintf(GFP_KERNEL, "{%pUL}", device_uuid.b);
639+
dev_name = kasprintf(GFP_KERNEL, "{%pUL}", &device_uuid);
643640
if (!dev_name)
644641
return -ENOMEM;
645642

drivers/hid/intel-ish-hid/ishtp/bus.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
112112

113113
int ishtp_register_event_cb(struct ishtp_cl_device *device,
114114
void (*read_cb)(struct ishtp_cl_device *));
115-
int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const uuid_le *cuuid);
115+
int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const guid_t *cuuid);
116116
struct ishtp_fw_client *ishtp_fw_cl_get_client(struct ishtp_device *dev,
117-
const uuid_le *uuid);
117+
const guid_t *uuid);
118118

119119
#endif /* _LINUX_ISHTP_CL_BUS_H */

drivers/hid/intel-ish-hid/ishtp/client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct ishtp_cl {
126126
};
127127

128128
/* Client connection managenment internal functions */
129-
int ishtp_can_client_connect(struct ishtp_device *ishtp_dev, uuid_le *uuid);
129+
int ishtp_can_client_connect(struct ishtp_device *ishtp_dev, guid_t *uuid);
130130
int ishtp_fw_cl_by_id(struct ishtp_device *dev, uint8_t client_id);
131131
void ishtp_cl_send_msg(struct ishtp_device *dev, struct ishtp_cl *cl);
132132
void recv_ishtp_cl_msg(struct ishtp_device *dev,

drivers/hid/intel-ish-hid/ishtp/hbm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ struct hbm_host_enum_response {
149149
} __packed;
150150

151151
struct ishtp_client_properties {
152-
uuid_le protocol_name;
152+
guid_t protocol_name;
153153
uint8_t protocol_version;
154154
uint8_t max_number_of_connections;
155155
uint8_t fixed_address;

0 commit comments

Comments
 (0)