Source
MODULE_PARM_DESC(channel_mask, "Bitmask of channels to accept <15:Channel16>...<1:Channel2><0:Channel1>");
/*
* ati_remote2 - ATI/Philips USB RF remote driver
*
* Copyright (C) 2005-2008 Ville Syrjala <syrjala@sci.fi>
* Copyright (C) 2007-2008 Peter Stokes <linux@dadeos.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*/
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_AUTHOR("Ville Syrjala <syrjala@sci.fi>");
MODULE_LICENSE("GPL");
/*
* ATI Remote Wonder II Channel Configuration
*
* The remote control can be assigned one of sixteen "channels" in order to facilitate
* the use of multiple remote controls within range of each other.
* A remote's "channel" may be altered by pressing and holding the "PC" button for
* approximately 3 seconds, after which the button will slowly flash the count of the
* currently configured "channel", using the numeric keypad enter a number between 1 and
* 16 and then press the "PC" button again, the button will slowly flash the count of the
* newly configured "channel".
*/
enum {
ATI_REMOTE2_MAX_CHANNEL_MASK = 0xFFFF,
ATI_REMOTE2_MAX_MODE_MASK = 0x1F,
};
static int ati_remote2_set_mask(const char *val,
const struct kernel_param *kp,
unsigned int max)
{
unsigned int mask;
int ret;
if (!val)
return -EINVAL;
ret = kstrtouint(val, 0, &mask);
if (ret)
return ret;
if (mask & ~max)
return -EINVAL;
*(unsigned int *)kp->arg = mask;
return 0;
}
static int ati_remote2_set_channel_mask(const char *val,
const struct kernel_param *kp)
{