aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/mceusb.c
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2010-12-15 17:20:55 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-20 11:11:17 -0500
commitd8cc7fd7e6371026c15254a35e618d2e5c5bf562 (patch)
tree8afb236baf74c971b2a8c3648aea31fd89425302 /drivers/media/IR/mceusb.c
parentfbb1f1b0db9b196928157f97515a7ea537310ebc (diff)
[media] mceusb: fix inverted mask inversion logic
As it turns out, somewhere along the way, we managed to invert the meaning of the tx_mask_inverted flag. Looking back over the old lirc driver, tx_mask_inverted was set to 0 if the device was in tx_mask_list. Now we have a tx_mask_inverted flag set to 1 for all the devices that were in the list, and set tx_mask_inverted to that flag value, which is actually the opposite of what we used to set, causing set_tx_mask to use the wrong mask setting option. Since there seem to be more devices with inverted masks than not (using the original device as the baseline for inverted vs. normal), lets just call the ones currently marked as inverted normal instead, and flip the if/else actions that key off of the inverted flag. Note: the problem only cropped up if a call to set_tx_mask was made, if no mask was set, the device would work just fine, which is why this managed to slip though w/o getting noticed until now. Tested successfully by myself and Dennis Gilmore. Reported-by: Dennis Gilmore <dgilmore@redhat.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/mceusb.c')
-rw-r--r--drivers/media/IR/mceusb.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c
index eb965613259..3a968f082e6 100644
--- a/drivers/media/IR/mceusb.c
+++ b/drivers/media/IR/mceusb.c
@@ -156,7 +156,7 @@ struct mceusb_model {
156 u32 mce_gen1:1; 156 u32 mce_gen1:1;
157 u32 mce_gen2:1; 157 u32 mce_gen2:1;
158 u32 mce_gen3:1; 158 u32 mce_gen3:1;
159 u32 tx_mask_inverted:1; 159 u32 tx_mask_normal:1;
160 u32 is_polaris:1; 160 u32 is_polaris:1;
161 u32 no_tx:1; 161 u32 no_tx:1;
162 162
@@ -167,18 +167,18 @@ struct mceusb_model {
167static const struct mceusb_model mceusb_model[] = { 167static const struct mceusb_model mceusb_model[] = {
168 [MCE_GEN1] = { 168 [MCE_GEN1] = {
169 .mce_gen1 = 1, 169 .mce_gen1 = 1,
170 .tx_mask_inverted = 1, 170 .tx_mask_normal = 1,
171 }, 171 },
172 [MCE_GEN2] = { 172 [MCE_GEN2] = {
173 .mce_gen2 = 1, 173 .mce_gen2 = 1,
174 }, 174 },
175 [MCE_GEN2_TX_INV] = { 175 [MCE_GEN2_TX_INV] = {
176 .mce_gen2 = 1, 176 .mce_gen2 = 1,
177 .tx_mask_inverted = 1, 177 .tx_mask_normal = 1,
178 }, 178 },
179 [MCE_GEN3] = { 179 [MCE_GEN3] = {
180 .mce_gen3 = 1, 180 .mce_gen3 = 1,
181 .tx_mask_inverted = 1, 181 .tx_mask_normal = 1,
182 }, 182 },
183 [POLARIS_EVK] = { 183 [POLARIS_EVK] = {
184 .is_polaris = 1, 184 .is_polaris = 1,
@@ -350,7 +350,7 @@ struct mceusb_dev {
350 350
351 struct { 351 struct {
352 u32 connected:1; 352 u32 connected:1;
353 u32 tx_mask_inverted:1; 353 u32 tx_mask_normal:1;
354 u32 microsoft_gen1:1; 354 u32 microsoft_gen1:1;
355 u32 no_tx:1; 355 u32 no_tx:1;
356 } flags; 356 } flags;
@@ -753,11 +753,11 @@ static int mceusb_set_tx_mask(void *priv, u32 mask)
753{ 753{
754 struct mceusb_dev *ir = priv; 754 struct mceusb_dev *ir = priv;
755 755
756 if (ir->flags.tx_mask_inverted) 756 if (ir->flags.tx_mask_normal)
757 ir->tx_mask = mask;
758 else
757 ir->tx_mask = (mask != MCE_DEFAULT_TX_MASK ? 759 ir->tx_mask = (mask != MCE_DEFAULT_TX_MASK ?
758 mask ^ MCE_DEFAULT_TX_MASK : mask) << 1; 760 mask ^ MCE_DEFAULT_TX_MASK : mask) << 1;
759 else
760 ir->tx_mask = mask;
761 761
762 return 0; 762 return 0;
763} 763}
@@ -1117,7 +1117,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
1117 enum mceusb_model_type model = id->driver_info; 1117 enum mceusb_model_type model = id->driver_info;
1118 bool is_gen3; 1118 bool is_gen3;
1119 bool is_microsoft_gen1; 1119 bool is_microsoft_gen1;
1120 bool tx_mask_inverted; 1120 bool tx_mask_normal;
1121 bool is_polaris; 1121 bool is_polaris;
1122 1122
1123 dev_dbg(&intf->dev, "%s called\n", __func__); 1123 dev_dbg(&intf->dev, "%s called\n", __func__);
@@ -1126,7 +1126,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
1126 1126
1127 is_gen3 = mceusb_model[model].mce_gen3; 1127 is_gen3 = mceusb_model[model].mce_gen3;
1128 is_microsoft_gen1 = mceusb_model[model].mce_gen1; 1128 is_microsoft_gen1 = mceusb_model[model].mce_gen1;
1129 tx_mask_inverted = mceusb_model[model].tx_mask_inverted; 1129 tx_mask_normal = mceusb_model[model].tx_mask_normal;
1130 is_polaris = mceusb_model[model].is_polaris; 1130 is_polaris = mceusb_model[model].is_polaris;
1131 1131
1132 if (is_polaris) { 1132 if (is_polaris) {
@@ -1193,7 +1193,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
1193 ir->dev = &intf->dev; 1193 ir->dev = &intf->dev;
1194 ir->len_in = maxp; 1194 ir->len_in = maxp;
1195 ir->flags.microsoft_gen1 = is_microsoft_gen1; 1195 ir->flags.microsoft_gen1 = is_microsoft_gen1;
1196 ir->flags.tx_mask_inverted = tx_mask_inverted; 1196 ir->flags.tx_mask_normal = tx_mask_normal;
1197 ir->flags.no_tx = mceusb_model[model].no_tx; 1197 ir->flags.no_tx = mceusb_model[model].no_tx;
1198 ir->model = model; 1198 ir->model = model;
1199 1199