Lines Matching defs:filter

940  * @filter:	the scancode and mask
942 * return: 0 or -EINVAL if the filter is not valid
945 struct rc_scancode_filter *filter)
947 u32 mask, s = filter->data;
958 filter->data &= mask;
959 filter->mask &= mask;
964 if (dev->encode_wakeup && filter->mask != 0 && filter->mask != mask)
1072 * struct rc_filter_attribute - Device attribute relating to a filter type.
1075 * @mask: false for filter value, true for filter mask.
1282 struct rc_scancode_filter *filter;
1288 filter = &dev->scancode_filter;
1324 * If a protocol change was attempted the filter may need updating, even
1326 * cleared the filter).
1327 * Try setting the same filter with the new protocol (if any).
1328 * Fall back to clearing the filter.
1330 if (dev->s_filter && filter->mask) {
1332 rc = dev->s_filter(dev, filter);
1337 filter->data = 0;
1338 filter->mask = 0;
1339 dev->s_filter(dev, filter);
1351 * show_filter() - shows the current scancode filter value or mask
1356 * This routine is a callback routine to read a scancode filter value or mask.
1357 * It is triggered by reading /sys/class/rc/rc?/[wakeup_]filter[_mask].
1358 * It prints the current scancode filter value or mask of the appropriate filter
1361 * Bits of the filter value corresponding to set bits in the filter mask are
1373 struct rc_scancode_filter *filter;
1379 filter = &dev->scancode_filter;
1381 filter = &dev->scancode_wakeup_filter;
1384 val = filter->mask;
1386 val = filter->data;
1393 * store_filter() - changes the scancode filter value
1399 * This routine is for changing a scancode filter value or mask.
1400 * It is triggered by writing to /sys/class/rc/rc?/[wakeup_]filter[_mask].
1401 * Returns -EINVAL if an invalid filter value for the current protocol was
1405 * Bits of the filter value corresponding to set bits in the filter mask are
1417 struct rc_scancode_filter new_filter, *filter;
1420 int (*set_filter)(struct rc_dev *dev, struct rc_scancode_filter *filter);
1428 filter = &dev->scancode_filter;
1431 filter = &dev->scancode_wakeup_filter;
1443 new_filter = *filter;
1451 * Refuse to set a filter unless a protocol is enabled
1452 * and the filter is valid for that protocol
1465 /* refuse to set a filter unless a protocol is enabled */
1474 *filter = new_filter;
1647 static RC_FILTER_ATTR(filter, S_IRUGO|S_IWUSR,