@@ -1145,17 +1145,26 @@ static int armv8_pmu_init_nogroups(struct arm_pmu *cpu_pmu, char *name,
1145
1145
return armv8_pmu_init (cpu_pmu , name , map_event , NULL , NULL , NULL );
1146
1146
}
1147
1147
1148
- static int armv8_pmuv3_init ( struct arm_pmu * cpu_pmu )
1149
- {
1150
- return armv8_pmu_init_nogroups ( cpu_pmu , "armv8_pmuv3" ,
1151
- armv8_pmuv3_map_event );
1148
+ #define PMUV3_INIT_SIMPLE ( name ) \
1149
+ static int name##_pmu_init(struct arm_pmu *cpu_pmu) \
1150
+ { \
1151
+ return armv8_pmu_init_nogroups(cpu_pmu, #name, armv8_pmuv3_map_event);\
1152
1152
}
1153
1153
1154
- static int armv8_a34_pmu_init (struct arm_pmu * cpu_pmu )
1155
- {
1156
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a34" ,
1157
- armv8_pmuv3_map_event );
1158
- }
1154
+ PMUV3_INIT_SIMPLE (armv8_pmuv3 )
1155
+
1156
+ PMUV3_INIT_SIMPLE (armv8_cortex_a34 )
1157
+ PMUV3_INIT_SIMPLE (armv8_cortex_a55 )
1158
+ PMUV3_INIT_SIMPLE (armv8_cortex_a65 )
1159
+ PMUV3_INIT_SIMPLE (armv8_cortex_a75 )
1160
+ PMUV3_INIT_SIMPLE (armv8_cortex_a76 )
1161
+ PMUV3_INIT_SIMPLE (armv8_cortex_a77 )
1162
+ PMUV3_INIT_SIMPLE (armv8_cortex_a78 )
1163
+ PMUV3_INIT_SIMPLE (armv8_neoverse_e1 )
1164
+ PMUV3_INIT_SIMPLE (armv8_neoverse_n1 )
1165
+
1166
+ PMUV3_INIT_SIMPLE (armv8_nvidia_carmel )
1167
+ PMUV3_INIT_SIMPLE (armv8_nvidia_denver )
1159
1168
1160
1169
static int armv8_a35_pmu_init (struct arm_pmu * cpu_pmu )
1161
1170
{
@@ -1169,24 +1178,12 @@ static int armv8_a53_pmu_init(struct arm_pmu *cpu_pmu)
1169
1178
armv8_a53_map_event );
1170
1179
}
1171
1180
1172
- static int armv8_a55_pmu_init (struct arm_pmu * cpu_pmu )
1173
- {
1174
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a55" ,
1175
- armv8_pmuv3_map_event );
1176
- }
1177
-
1178
1181
static int armv8_a57_pmu_init (struct arm_pmu * cpu_pmu )
1179
1182
{
1180
1183
return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a57" ,
1181
1184
armv8_a57_map_event );
1182
1185
}
1183
1186
1184
- static int armv8_a65_pmu_init (struct arm_pmu * cpu_pmu )
1185
- {
1186
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a65" ,
1187
- armv8_pmuv3_map_event );
1188
- }
1189
-
1190
1187
static int armv8_a72_pmu_init (struct arm_pmu * cpu_pmu )
1191
1188
{
1192
1189
return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a72" ,
@@ -1199,42 +1196,6 @@ static int armv8_a73_pmu_init(struct arm_pmu *cpu_pmu)
1199
1196
armv8_a73_map_event );
1200
1197
}
1201
1198
1202
- static int armv8_a75_pmu_init (struct arm_pmu * cpu_pmu )
1203
- {
1204
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a75" ,
1205
- armv8_pmuv3_map_event );
1206
- }
1207
-
1208
- static int armv8_a76_pmu_init (struct arm_pmu * cpu_pmu )
1209
- {
1210
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a76" ,
1211
- armv8_pmuv3_map_event );
1212
- }
1213
-
1214
- static int armv8_a77_pmu_init (struct arm_pmu * cpu_pmu )
1215
- {
1216
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a77" ,
1217
- armv8_pmuv3_map_event );
1218
- }
1219
-
1220
- static int armv8_a78_pmu_init (struct arm_pmu * cpu_pmu )
1221
- {
1222
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cortex_a78" ,
1223
- armv8_pmuv3_map_event );
1224
- }
1225
-
1226
- static int armv8_e1_pmu_init (struct arm_pmu * cpu_pmu )
1227
- {
1228
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_neoverse_e1" ,
1229
- armv8_pmuv3_map_event );
1230
- }
1231
-
1232
- static int armv8_n1_pmu_init (struct arm_pmu * cpu_pmu )
1233
- {
1234
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_neoverse_n1" ,
1235
- armv8_pmuv3_map_event );
1236
- }
1237
-
1238
1199
static int armv8_thunder_pmu_init (struct arm_pmu * cpu_pmu )
1239
1200
{
1240
1201
return armv8_pmu_init_nogroups (cpu_pmu , "armv8_cavium_thunder" ,
@@ -1247,38 +1208,26 @@ static int armv8_vulcan_pmu_init(struct arm_pmu *cpu_pmu)
1247
1208
armv8_vulcan_map_event );
1248
1209
}
1249
1210
1250
- static int armv8_carmel_pmu_init (struct arm_pmu * cpu_pmu )
1251
- {
1252
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_nvidia_carmel" ,
1253
- armv8_pmuv3_map_event );
1254
- }
1255
-
1256
- static int armv8_denver_pmu_init (struct arm_pmu * cpu_pmu )
1257
- {
1258
- return armv8_pmu_init_nogroups (cpu_pmu , "armv8_nvidia_denver" ,
1259
- armv8_pmuv3_map_event );
1260
- }
1261
-
1262
1211
static const struct of_device_id armv8_pmu_of_device_ids [] = {
1263
- {.compatible = "arm,armv8-pmuv3" , .data = armv8_pmuv3_init },
1264
- {.compatible = "arm,cortex-a34-pmu" , .data = armv8_a34_pmu_init },
1212
+ {.compatible = "arm,armv8-pmuv3" , .data = armv8_pmuv3_pmu_init },
1213
+ {.compatible = "arm,cortex-a34-pmu" , .data = armv8_cortex_a34_pmu_init },
1265
1214
{.compatible = "arm,cortex-a35-pmu" , .data = armv8_a35_pmu_init },
1266
1215
{.compatible = "arm,cortex-a53-pmu" , .data = armv8_a53_pmu_init },
1267
- {.compatible = "arm,cortex-a55-pmu" , .data = armv8_a55_pmu_init },
1216
+ {.compatible = "arm,cortex-a55-pmu" , .data = armv8_cortex_a55_pmu_init },
1268
1217
{.compatible = "arm,cortex-a57-pmu" , .data = armv8_a57_pmu_init },
1269
- {.compatible = "arm,cortex-a65-pmu" , .data = armv8_a65_pmu_init },
1218
+ {.compatible = "arm,cortex-a65-pmu" , .data = armv8_cortex_a65_pmu_init },
1270
1219
{.compatible = "arm,cortex-a72-pmu" , .data = armv8_a72_pmu_init },
1271
1220
{.compatible = "arm,cortex-a73-pmu" , .data = armv8_a73_pmu_init },
1272
- {.compatible = "arm,cortex-a75-pmu" , .data = armv8_a75_pmu_init },
1273
- {.compatible = "arm,cortex-a76-pmu" , .data = armv8_a76_pmu_init },
1274
- {.compatible = "arm,cortex-a77-pmu" , .data = armv8_a77_pmu_init },
1275
- {.compatible = "arm,cortex-a78-pmu" , .data = armv8_a78_pmu_init },
1276
- {.compatible = "arm,neoverse-e1-pmu" , .data = armv8_e1_pmu_init },
1277
- {.compatible = "arm,neoverse-n1-pmu" , .data = armv8_n1_pmu_init },
1221
+ {.compatible = "arm,cortex-a75-pmu" , .data = armv8_cortex_a75_pmu_init },
1222
+ {.compatible = "arm,cortex-a76-pmu" , .data = armv8_cortex_a76_pmu_init },
1223
+ {.compatible = "arm,cortex-a77-pmu" , .data = armv8_cortex_a77_pmu_init },
1224
+ {.compatible = "arm,cortex-a78-pmu" , .data = armv8_cortex_a78_pmu_init },
1225
+ {.compatible = "arm,neoverse-e1-pmu" , .data = armv8_neoverse_e1_pmu_init },
1226
+ {.compatible = "arm,neoverse-n1-pmu" , .data = armv8_neoverse_n1_pmu_init },
1278
1227
{.compatible = "cavium,thunder-pmu" , .data = armv8_thunder_pmu_init },
1279
1228
{.compatible = "brcm,vulcan-pmu" , .data = armv8_vulcan_pmu_init },
1280
- {.compatible = "nvidia,carmel-pmu" , .data = armv8_carmel_pmu_init },
1281
- {.compatible = "nvidia,denver-pmu" , .data = armv8_denver_pmu_init },
1229
+ {.compatible = "nvidia,carmel-pmu" , .data = armv8_nvidia_carmel_pmu_init },
1230
+ {.compatible = "nvidia,denver-pmu" , .data = armv8_nvidia_denver_pmu_init },
1282
1231
{},
1283
1232
};
1284
1233
@@ -1301,7 +1250,7 @@ static int __init armv8_pmu_driver_init(void)
1301
1250
if (acpi_disabled )
1302
1251
return platform_driver_register (& armv8_pmu_driver );
1303
1252
else
1304
- return arm_pmu_acpi_probe (armv8_pmuv3_init );
1253
+ return arm_pmu_acpi_probe (armv8_pmuv3_pmu_init );
1305
1254
}
1306
1255
device_initcall (armv8_pmu_driver_init )
1307
1256
0 commit comments