~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/gpu/drm/nouveau/nv50_gpio.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
        struct nv50_gpio_priv *priv = pgpio->priv;
138
138
        struct nv50_gpio_handler *gpioh, *tmp;
139
139
        struct dcb_gpio_entry *gpio;
 
140
        LIST_HEAD(tofree);
140
141
        unsigned long flags;
141
142
 
142
143
        gpio = nouveau_bios_gpio_entry(dev, tag);
149
150
                    gpioh->handler != handler ||
150
151
                    gpioh->data != data)
151
152
                        continue;
152
 
                list_del(&gpioh->head);
 
153
                list_move(&gpioh->head, &tofree);
 
154
        }
 
155
        spin_unlock_irqrestore(&priv->lock, flags);
 
156
 
 
157
        list_for_each_entry_safe(gpioh, tmp, &tofree, head) {
 
158
                flush_work_sync(&gpioh->work);
153
159
                kfree(gpioh);
154
160
        }
155
 
        spin_unlock_irqrestore(&priv->lock, flags);
156
161
}
157
162
 
158
163
bool
205
210
{
206
211
        struct drm_nouveau_private *dev_priv = dev->dev_private;
207
212
        struct nouveau_gpio_engine *pgpio = &dev_priv->engine.gpio;
208
 
        struct nv50_gpio_priv *priv;
209
213
        int ret;
210
214
 
211
215
        if (!pgpio->priv) {
213
217
                if (ret)
214
218
                        return ret;
215
219
        }
216
 
        priv = pgpio->priv;
217
220
 
218
221
        /* disable, and ack any pending gpio interrupts */
219
222
        nv_wr32(dev, 0xe050, 0x00000000);
293
296
                        continue;
294
297
                gpioh->inhibit = true;
295
298
 
296
 
                queue_work(dev_priv->wq, &gpioh->work);
 
299
                schedule_work(&gpioh->work);
297
300
        }
298
301
        spin_unlock(&priv->lock);
299
302
}