Merge branch 'for-linus' to bring in change ensuring that drivers that
[linux-2.6-block.git] / drivers / input / touchscreen / ad7879.c
index bd4eb42776973b211aee79e40f51b47e2f5e8d27..facd3057b62dcb4aa634c41a674197ad1c5871e2 100644 (file)
@@ -118,6 +118,7 @@ struct ad7879 {
        unsigned int            irq;
        bool                    disabled;       /* P: input->mutex */
        bool                    suspended;      /* P: input->mutex */
+       bool                    swap_xy;
        u16                     conversion_data[AD7879_NR_SENSE];
        char                    phys[32];
        u8                      first_conversion_delay;
@@ -161,6 +162,9 @@ static int ad7879_report(struct ad7879 *ts)
        z1 = ts->conversion_data[AD7879_SEQ_Z1] & MAX_12BIT;
        z2 = ts->conversion_data[AD7879_SEQ_Z2] & MAX_12BIT;
 
+       if (ts->swap_xy)
+               swap(x, y);
+
        /*
         * The samples processed here are already preprocessed by the AD7879.
         * The preprocessing function consists of a median and an averaging
@@ -520,6 +524,7 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq,
        ts->dev = dev;
        ts->input = input_dev;
        ts->irq = irq;
+       ts->swap_xy = pdata->swap_xy;
 
        setup_timer(&ts->timer, ad7879_timer, (unsigned long) ts);