Commit 3446d7e9 authored by Qiang Yu's avatar Qiang Yu
Browse files

drm/lima: add resume/suspend callback for each ip

parent 9f5072a1
Loading
Loading
Loading
Loading
+20 −5
Original line number Diff line number Diff line
@@ -26,18 +26,33 @@ void lima_bcast_enable(struct lima_device *dev, int num_pp)
	bcast_write(LIMA_BCAST_BROADCAST_MASK, mask);
}

static int lima_bcast_hw_init(struct lima_ip *ip)
{
	bcast_write(LIMA_BCAST_BROADCAST_MASK, ip->data.mask << 16);
	bcast_write(LIMA_BCAST_INTERRUPT_MASK, ip->data.mask);
	return 0;
}

int lima_bcast_resume(struct lima_ip *ip)
{
	return lima_bcast_hw_init(ip);
}

void lima_bcast_suspend(struct lima_ip *ip)
{

}

int lima_bcast_init(struct lima_ip *ip)
{
	int i, mask = 0;
	int i;

	for (i = lima_ip_pp0; i <= lima_ip_pp7; i++) {
		if (ip->dev->ip[i].present)
			mask |= 1 << (i - lima_ip_pp0);
			ip->data.mask |= 1 << (i - lima_ip_pp0);
	}

	bcast_write(LIMA_BCAST_BROADCAST_MASK, mask << 16);
	bcast_write(LIMA_BCAST_INTERRUPT_MASK, mask);
	return 0;
	return lima_bcast_hw_init(ip);
}

void lima_bcast_fini(struct lima_ip *ip)
+2 −0
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@

struct lima_ip;

int lima_bcast_resume(struct lima_ip *ip);
void lima_bcast_suspend(struct lima_ip *ip);
int lima_bcast_init(struct lima_ip *ip);
void lima_bcast_fini(struct lima_ip *ip);

+4 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ struct lima_ip_desc {

	int (*init)(struct lima_ip *ip);
	void (*fini)(struct lima_ip *ip);
	int (*resume)(struct lima_ip *ip);
	void (*suspend)(struct lima_ip *ip);
};

#define LIMA_IP_DESC(ipname, mst0, mst1, off0, off1, func, irq) \
@@ -41,6 +43,8 @@ struct lima_ip_desc {
		}, \
		.init = lima_##func##_init, \
		.fini = lima_##func##_fini, \
		.resume = lima_##func##_resume, \
		.suspend = lima_##func##_suspend, \
	}

static struct lima_ip_desc lima_ip_desc[lima_ip_num] = {
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ struct lima_ip {
		bool async_reset;
		/* l2 cache */
		spinlock_t lock;
		/* pmu */
		/* pmu/bcast */
		u32 mask;
	} data;
};
+16 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ void lima_dlbu_set_reg(struct lima_ip *ip, u32 *reg)
	dlbu_write(LIMA_DLBU_START_TILE_POS, reg[3]);
}

int lima_dlbu_init(struct lima_ip *ip)
static int lima_dlbu_hw_init(struct lima_ip *ip)
{
	struct lima_device *dev = ip->dev;

@@ -52,6 +52,21 @@ int lima_dlbu_init(struct lima_ip *ip)
	return 0;
}

int lima_dlbu_resume(struct lima_ip *ip)
{
	return lima_dlbu_hw_init(ip);
}

void lima_dlbu_suspend(struct lima_ip *ip)
{

}

int lima_dlbu_init(struct lima_ip *ip)
{
	return lima_dlbu_hw_init(ip);
}

void lima_dlbu_fini(struct lima_ip *ip)
{

Loading