Lines Matching refs:joy

40 	struct adc_joystick *joy = input_get_drvdata(input);  in adc_joystick_poll()  local
43 for (i = 0; i < joy->num_chans; i++) { in adc_joystick_poll()
44 ret = iio_read_channel_raw(&joy->chans[i], &val); in adc_joystick_poll()
47 if (joy->axes[i].inverted) in adc_joystick_poll()
49 input_report_abs(input, joy->axes[i].code, val); in adc_joystick_poll()
56 struct adc_joystick *joy = private; in adc_joystick_handle() local
62 bytes = joy->chans[0].channel->scan_type.storagebits >> 3; in adc_joystick_handle()
64 for (i = 0; i < joy->num_chans; ++i) { in adc_joystick_handle()
65 idx = joy->chans[i].channel->scan_index; in adc_joystick_handle()
66 endianness = joy->chans[i].channel->scan_type.endianness; in adc_joystick_handle()
67 msb = joy->chans[i].channel->scan_type.realbits - 1; in adc_joystick_handle()
68 sign = tolower(joy->chans[i].channel->scan_type.sign) == 's'; in adc_joystick_handle()
92 val >>= joy->chans[i].channel->scan_type.shift; in adc_joystick_handle()
97 if (joy->axes[i].inverted) in adc_joystick_handle()
98 val = adc_joystick_invert(joy->input, i, val); in adc_joystick_handle()
99 input_report_abs(joy->input, joy->axes[i].code, val); in adc_joystick_handle()
102 input_sync(joy->input); in adc_joystick_handle()
109 struct adc_joystick *joy = input_get_drvdata(dev); in adc_joystick_open() local
113 ret = iio_channel_start_all_cb(joy->buffer); in adc_joystick_open()
122 struct adc_joystick *joy = input_get_drvdata(dev); in adc_joystick_close() local
124 iio_channel_stop_all_cb(joy->buffer); in adc_joystick_close()
132 static int adc_joystick_set_axes(struct device *dev, struct adc_joystick *joy) in adc_joystick_set_axes() argument
134 struct adc_joystick_axis *axes = joy->axes; in adc_joystick_set_axes()
145 if (num_axes != joy->num_chans) { in adc_joystick_set_axes()
147 num_axes, joy->num_chans); in adc_joystick_set_axes()
189 input_set_abs_params(joy->input, axes[i].code, in adc_joystick_set_axes()
231 struct adc_joystick *joy; in adc_joystick_probe() local
260 joy = devm_kzalloc(dev, struct_size(joy, axes, num_chans), GFP_KERNEL); in adc_joystick_probe()
261 if (!joy) in adc_joystick_probe()
264 joy->chans = chans; in adc_joystick_probe()
265 joy->num_chans = num_chans; in adc_joystick_probe()
273 joy->input = input; in adc_joystick_probe()
277 error = adc_joystick_set_axes(dev, joy); in adc_joystick_probe()
288 joy->buffer = iio_channel_get_all_cb(dev, adc_joystick_handle, in adc_joystick_probe()
289 joy); in adc_joystick_probe()
290 if (IS_ERR(joy->buffer)) { in adc_joystick_probe()
292 return PTR_ERR(joy->buffer); in adc_joystick_probe()
296 joy->buffer); in adc_joystick_probe()
303 input_set_drvdata(input, joy); in adc_joystick_probe()