Exemplo n.º 1
0
/* Caller must hold the device mutex. */
int kgsl_pwrctrl_wake(struct kgsl_device *device)
{
	int status = KGSL_SUCCESS;
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;

	BUG_ON(!mutex_is_locked(&device->mutex));

	if (device->state == KGSL_STATE_SUSPEND)
		return status;

	KGSL_DRV_INFO("GRP_CLK= %lu BUS CLK= %lu\n",
		kgsl_get_clkrate(pwr->grp_clk),	kgsl_get_clkrate(pwr->ebi1_clk));

	/* Turn on the core clocks */
	status = kgsl_pwrctrl_clk(device, KGSL_PWRFLAGS_CLK_ON);
	if (device->state != KGSL_STATE_NAP) {
		kgsl_pwrctrl_axi(device, KGSL_PWRFLAGS_AXI_ON);
	}
	/* Enable state before turning on irq */
	device->state = KGSL_STATE_ACTIVE;
	KGSL_DRV_WARN("state -> ACTIVE, device %d\n", device->id);
	kgsl_pwrctrl_irq(device, KGSL_PWRFLAGS_IRQ_ON);

	/* Re-enable HW access */
	mod_timer(&device->idle_timer, jiffies + FIRST_TIMEOUT);

	KGSL_DRV_VDBG("<-- kgsl_yamato_wake(). Return value %d\n", status);
	wake_lock(&device->idle_wakelock);

	return status;
}
Exemplo n.º 2
0
irqreturn_t kgsl_g12_isr(int irq, void *data)
{
	irqreturn_t result = IRQ_NONE;

	struct kgsl_device *device = &kgsl_driver.g12_device;
	unsigned int status;
	kgsl_g12_regread(device, ADDR_VGC_IRQSTATUS >> 2, &status);

	if (status & GSL_VGC_INT_MASK) {
		kgsl_g12_regwrite(device,
			ADDR_VGC_IRQSTATUS >> 2, status & GSL_VGC_INT_MASK);

		result = IRQ_HANDLED;

		if (status & REG_VGC_IRQSTATUS__FIFO_MASK)
			KGSL_DRV_ERR("g12 fifo interrupt\n");
		else if (status & REG_VGC_IRQSTATUS__MH_MASK)
			KGSL_DRV_ERR("g12 mh interrupt\n");
		else if (status & REG_VGC_IRQSTATUS__G2D_MASK) {
				KGSL_DRV_VDBG("g12 g2d interrupt\n");
				queue_work(device->irq_wq, &(device->irq_work));
			}
		else
			KGSL_DRV_ERR(
				"bad bits in ADDR_VGC_IRQ_STATUS %08x\n",
						status);

	}
Exemplo n.º 3
0
irqreturn_t kgsl_g12_isr(int irq, void *data)
{
	irqreturn_t result = IRQ_NONE;

	struct kgsl_device *device = &kgsl_driver.g12_device;
	unsigned int status;
	kgsl_g12_regread(device, ADDR_VGC_IRQSTATUS >> 2, &status);

	if (status & GSL_VGC_INT_MASK) {
		kgsl_g12_regwrite(device,
			ADDR_VGC_IRQSTATUS >> 2, status & GSL_VGC_INT_MASK);

		result = IRQ_HANDLED;

		if (status & REG_VGC_IRQSTATUS__FIFO_MASK)
			KGSL_DRV_ERR("g12 fifo interrupt\n");
		if (status & REG_VGC_IRQSTATUS__MH_MASK)
			kgsl_mh_intrcallback(device);
		if (status & REG_VGC_IRQSTATUS__G2D_MASK) {
			int count;

			KGSL_DRV_VDBG("g12 g2d interrupt\n");
			kgsl_g12_regread(device,
					 ADDR_VGC_IRQ_ACTIVE_CNT >> 2,
					 &count);

			count >>= 8;
			count &= 255;
			device->timestamp += count;

			wake_up_interruptible(&(device->wait_timestamp_wq));
		}
Exemplo n.º 4
0
irqreturn_t kgsl_g12_isr(int irq, void *data)
{
irqreturn_t result = IRQ_NONE;
unsigned int status;
struct kgsl_device *device;
struct kgsl_g12_device *g12_device;

device = (struct kgsl_device *) data;
g12_device =  (struct kgsl_g12_device *) device;

kgsl_g12_regread(device, ADDR_VGC_IRQSTATUS >> 2, &status);

if (status & GSL_VGC_INT_MASK) {
    kgsl_g12_regwrite(device,
                      ADDR_VGC_IRQSTATUS >> 2, status & GSL_VGC_INT_MASK);

    result = IRQ_HANDLED;

    if (status & REG_VGC_IRQSTATUS__FIFO_MASK)
        KGSL_DRV_ERR("g12 fifo interrupt\n");
    if (status & REG_VGC_IRQSTATUS__MH_MASK)
        kgsl_mh_intrcallback(device);
    if (status & REG_VGC_IRQSTATUS__G2D_MASK) {
        int count;

        KGSL_DRV_VDBG("g12 g2d interrupt\n");
        kgsl_g12_regread(device,
                         ADDR_VGC_IRQ_ACTIVE_CNT >> 2,
                         &count);

        count >>= 8;
        count &= 255;
        g12_device->timestamp += count;

        wake_up_interruptible(&(g12_device->wait_timestamp_wq));

        atomic_notifier_call_chain(
            &(device->ts_notifier_list),
            KGSL_DEVICE_G12, NULL);
    }