Lines Matching refs:ip
11 #define pmu_write(reg, data) writel(data, ip->iomem + reg)
12 #define pmu_read(reg) readl(ip->iomem + reg)
14 static int lima_pmu_wait_cmd(struct lima_ip *ip)
16 struct lima_device *dev = ip->dev;
20 err = readl_poll_timeout(ip->iomem + LIMA_PMU_INT_RAWSTAT,
25 lima_ip_name(ip));
33 static u32 lima_pmu_get_ip_mask(struct lima_ip *ip)
35 struct lima_device *dev = ip->dev;
44 if (dev->ip[lima_ip_pp0 + i].present)
48 if (dev->ip[lima_ip_pp0].present)
51 if (dev->ip[i].present) {
57 if (dev->ip[i].present) {
67 static int lima_pmu_hw_init(struct lima_ip *ip)
82 /* power up all ip */
85 err = lima_pmu_wait_cmd(ip);
92 static void lima_pmu_hw_fini(struct lima_ip *ip)
96 if (!ip->data.mask)
97 ip->data.mask = lima_pmu_get_ip_mask(ip);
99 stat = ~pmu_read(LIMA_PMU_STATUS) & ip->data.mask;
107 if (ip->dev->id == lima_gpu_mali400)
110 lima_pmu_wait_cmd(ip);
114 int lima_pmu_resume(struct lima_ip *ip)
116 return lima_pmu_hw_init(ip);
119 void lima_pmu_suspend(struct lima_ip *ip)
121 lima_pmu_hw_fini(ip);
124 int lima_pmu_init(struct lima_ip *ip)
126 return lima_pmu_hw_init(ip);
129 void lima_pmu_fini(struct lima_ip *ip)
131 lima_pmu_hw_fini(ip);