@@ -135,7 +135,8 @@ struct rom_extinfo rom_read_extinfo(const char *name,
* @date.month: month ROM was created
* @date.day: day ROM was created
*
- * The @type name can be resolved with rom_type_name().
+ * The @region and @type names can be resolved with rom_region_name() and
+ * rom_type_name().
*
* Note that the Namco System 246 arcade systems are TOOL types as well.
*
@@ -155,6 +156,8 @@ struct rom_ver {
struct rom_ver rom_version(void);
+const char *rom_region_name(char region);
+
const char *rom_type_name(char type);
bool rom_empty_dir(const struct rom_dir dir);
@@ -383,6 +383,24 @@ struct rom_ver rom_version(void)
}
EXPORT_SYMBOL_GPL(rom_version);
+/**
+ * rom_region_name - name for the ROM region character in the ROMVER file
+ * @region: &rom_ver.region region character.
+ *
+ * Context: any
+ * Return: ROM region name, ``"-"`` if undefined or ``"?"`` if unrecognised
+ */
+const char *rom_region_name(char region)
+{
+ return region == 'J' ? "Japan" :
+ region == 'E' ? "Europe" :
+ region == 'C' ? "China" :
+ region == 'A' ? "USA" :
+ region == 'H' ? "USA" :
+ region == '-' ? "-" : "?";
+}
+EXPORT_SYMBOL_GPL(rom_region_name);
+
/**
* rom_type_name - name for the ROM type character in the ROMVER file in ROM0
* @type: &rom_ver.type type character.
@@ -675,8 +693,8 @@ static int __init ps2_rom_init(void)
rom1_dir = rom_dir_init("rom1", ROM1_BASE, ROM1_SIZE);
v = rom_version();
- pr_info("rom0: Version %04x %c %s %04d-%02d-%02d\n",
- v.number, v.region, rom_type_name(v.type),
+ pr_info("rom0: Version %04x %s %s %04d-%02d-%02d\n",
+ v.number, rom_region_name(v.region), rom_type_name(v.type),
v.date.year, v.date.month, v.date.day);
return 0;
'J' indicates Japan, 'E' indicates Europe, 'C' indicates China and 'A' and 'H' indicate the USA. Signed-off-by: Fredrik Noring <noring@nocrew.org> --- arch/mips/include/asm/mach-ps2/rom.h | 5 ++++- arch/mips/ps2/rom.c | 22 ++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-)