File tree Expand file tree Collapse file tree 4 files changed +28
-52
lines changed Expand file tree Collapse file tree 4 files changed +28
-52
lines changed Original file line number Diff line number Diff line change @@ -433,3 +433,28 @@ void gdsc_unregister(struct gdsc_desc *desc)
433
433
}
434
434
of_genpd_del_provider (dev -> of_node );
435
435
}
436
+
437
+ /*
438
+ * On SDM845+ the GPU GX domain is *almost* entirely controlled by the GMU
439
+ * running in the CX domain so the CPU doesn't need to know anything about the
440
+ * GX domain EXCEPT....
441
+ *
442
+ * Hardware constraints dictate that the GX be powered down before the CX. If
443
+ * the GMU crashes it could leave the GX on. In order to successfully bring back
444
+ * the device the CPU needs to disable the GX headswitch. There being no sane
445
+ * way to reach in and touch that register from deep inside the GPU driver we
446
+ * need to set up the infrastructure to be able to ensure that the GPU can
447
+ * ensure that the GX is off during this super special case. We do this by
448
+ * defining a GX gdsc with a dummy enable function and a "default" disable
449
+ * function.
450
+ *
451
+ * This allows us to attach with genpd_dev_pm_attach_by_name() in the GPU
452
+ * driver. During power up, nothing will happen from the CPU (and the GMU will
453
+ * power up normally but during power down this will ensure that the GX domain
454
+ * is *really* off - this gives us a semi standard way of doing what we need.
455
+ */
456
+ int gdsc_gx_do_nothing_enable (struct generic_pm_domain * domain )
457
+ {
458
+ /* Do nothing but give genpd the impression that we were successful */
459
+ return 0 ;
460
+ }
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ struct gdsc_desc {
68
68
int gdsc_register (struct gdsc_desc * desc , struct reset_controller_dev * ,
69
69
struct regmap * );
70
70
void gdsc_unregister (struct gdsc_desc * desc );
71
+ int gdsc_gx_do_nothing_enable (struct generic_pm_domain * domain );
71
72
#else
72
73
static inline int gdsc_register (struct gdsc_desc * desc ,
73
74
struct reset_controller_dev * rcdev ,
Original file line number Diff line number Diff line change @@ -170,37 +170,12 @@ static struct gdsc cx_gdsc = {
170
170
.flags = VOTABLE ,
171
171
};
172
172
173
- /*
174
- * On SC7180 the GPU GX domain is *almost* entirely controlled by the GMU
175
- * running in the CX domain so the CPU doesn't need to know anything about the
176
- * GX domain EXCEPT....
177
- *
178
- * Hardware constraints dictate that the GX be powered down before the CX. If
179
- * the GMU crashes it could leave the GX on. In order to successfully bring back
180
- * the device the CPU needs to disable the GX headswitch. There being no sane
181
- * way to reach in and touch that register from deep inside the GPU driver we
182
- * need to set up the infrastructure to be able to ensure that the GPU can
183
- * ensure that the GX is off during this super special case. We do this by
184
- * defining a GX gdsc with a dummy enable function and a "default" disable
185
- * function.
186
- *
187
- * This allows us to attach with genpd_dev_pm_attach_by_name() in the GPU
188
- * driver. During power up, nothing will happen from the CPU (and the GMU will
189
- * power up normally but during power down this will ensure that the GX domain
190
- * is *really* off - this gives us a semi standard way of doing what we need.
191
- */
192
- static int gx_gdsc_enable (struct generic_pm_domain * domain )
193
- {
194
- /* Do nothing but give genpd the impression that we were successful */
195
- return 0 ;
196
- }
197
-
198
173
static struct gdsc gx_gdsc = {
199
174
.gdscr = 0x100c ,
200
175
.clamp_io_ctrl = 0x1508 ,
201
176
.pd = {
202
177
.name = "gx_gdsc" ,
203
- .power_on = gx_gdsc_enable ,
178
+ .power_on = gdsc_gx_do_nothing_enable ,
204
179
},
205
180
.pwrsts = PWRSTS_OFF_ON ,
206
181
.flags = CLAMP_IO ,
Original file line number Diff line number Diff line change @@ -131,37 +131,12 @@ static struct gdsc gpu_cx_gdsc = {
131
131
.flags = VOTABLE ,
132
132
};
133
133
134
- /*
135
- * On SDM845 the GPU GX domain is *almost* entirely controlled by the GMU
136
- * running in the CX domain so the CPU doesn't need to know anything about the
137
- * GX domain EXCEPT....
138
- *
139
- * Hardware constraints dictate that the GX be powered down before the CX. If
140
- * the GMU crashes it could leave the GX on. In order to successfully bring back
141
- * the device the CPU needs to disable the GX headswitch. There being no sane
142
- * way to reach in and touch that register from deep inside the GPU driver we
143
- * need to set up the infrastructure to be able to ensure that the GPU can
144
- * ensure that the GX is off during this super special case. We do this by
145
- * defining a GX gdsc with a dummy enable function and a "default" disable
146
- * function.
147
- *
148
- * This allows us to attach with genpd_dev_pm_attach_by_name() in the GPU
149
- * driver. During power up, nothing will happen from the CPU (and the GMU will
150
- * power up normally but during power down this will ensure that the GX domain
151
- * is *really* off - this gives us a semi standard way of doing what we need.
152
- */
153
- static int gx_gdsc_enable (struct generic_pm_domain * domain )
154
- {
155
- /* Do nothing but give genpd the impression that we were successful */
156
- return 0 ;
157
- }
158
-
159
134
static struct gdsc gpu_gx_gdsc = {
160
135
.gdscr = 0x100c ,
161
136
.clamp_io_ctrl = 0x1508 ,
162
137
.pd = {
163
138
.name = "gpu_gx_gdsc" ,
164
- .power_on = gx_gdsc_enable ,
139
+ .power_on = gdsc_gx_do_nothing_enable ,
165
140
},
166
141
.pwrsts = PWRSTS_OFF_ON ,
167
142
.flags = CLAMP_IO | AON_RESET | POLL_CFG_GDSCR ,
You can’t perform that action at this time.
0 commit comments