Lines Matching refs:iforce

18 void iforce_dump_packet(struct iforce *iforce, char *msg, u16 cmd, unsigned char *data)  in iforce_dump_packet()  argument
20 dev_dbg(iforce->dev->dev.parent, "%s %s cmd = %04x, data = %*ph\n", in iforce_dump_packet()
27 int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data) in iforce_send_packet() argument
39 spin_lock_irqsave(&iforce->xmit_lock, flags); in iforce_send_packet()
41 head = iforce->xmit.head; in iforce_send_packet()
42 tail = iforce->xmit.tail; in iforce_send_packet()
46 dev_warn(&iforce->dev->dev, in iforce_send_packet()
48 spin_unlock_irqrestore(&iforce->xmit_lock, flags); in iforce_send_packet()
53 XMIT_INC(iforce->xmit.head, n+2); in iforce_send_packet()
58 iforce->xmit.buf[head] = HI(cmd); in iforce_send_packet()
60 iforce->xmit.buf[head] = LO(cmd); in iforce_send_packet()
66 memcpy(&iforce->xmit.buf[head], in iforce_send_packet()
70 memcpy(&iforce->xmit.buf[0], in iforce_send_packet()
76 spin_unlock_irqrestore(&iforce->xmit_lock, flags); in iforce_send_packet()
81 iforce->xport_ops->xmit(iforce); in iforce_send_packet()
88 int iforce_control_playback(struct iforce* iforce, u16 id, unsigned int value) in iforce_control_playback() argument
95 return iforce_send_packet(iforce, FF_CMD_PLAY, data); in iforce_control_playback()
100 static int mark_core_as_ready(struct iforce *iforce, unsigned short addr) in mark_core_as_ready() argument
104 if (!iforce->dev->ff) in mark_core_as_ready()
107 for (i = 0; i < iforce->dev->ff->max_effects; ++i) { in mark_core_as_ready()
108 if (test_bit(FF_CORE_IS_USED, iforce->core_effects[i].flags) && in mark_core_as_ready()
109 (iforce->core_effects[i].mod1_chunk.start == addr || in mark_core_as_ready()
110 iforce->core_effects[i].mod2_chunk.start == addr)) { in mark_core_as_ready()
111 clear_bit(FF_CORE_UPDATE, iforce->core_effects[i].flags); in mark_core_as_ready()
115 dev_warn(&iforce->dev->dev, "unused effect %04x updated !!!\n", addr); in mark_core_as_ready()
119 static void iforce_report_hats_buttons(struct iforce *iforce, u8 *data) in iforce_report_hats_buttons() argument
121 struct input_dev *dev = iforce->dev; in iforce_report_hats_buttons()
127 for (i = 0; iforce->type->btn[i] >= 0; i++) in iforce_report_hats_buttons()
128 input_report_key(dev, iforce->type->btn[i], in iforce_report_hats_buttons()
155 void iforce_process_packet(struct iforce *iforce, in iforce_process_packet() argument
158 struct input_dev *dev = iforce->dev; in iforce_process_packet()
173 iforce_report_hats_buttons(iforce, data); in iforce_process_packet()
184 iforce_report_hats_buttons(iforce, data); in iforce_process_packet()
196 if (!test_and_set_bit(FF_CORE_IS_PLAYED, iforce->core_effects[i].flags)) { in iforce_process_packet()
200 } else if (test_and_clear_bit(FF_CORE_IS_PLAYED, iforce->core_effects[i].flags)) { in iforce_process_packet()
206 mark_core_as_ready(iforce, get_unaligned_le16(data + j)); in iforce_process_packet()