@@ -34,6 +34,10 @@ struct gs_synch_gen {
u32 spml : 4;
};
+bool gs_region_pal(void);
+
+bool gs_region_ntsc(void);
+
u32 gs_video_clock(const u32 t1248, const u32 lc, const u32 rc);
u32 gs_video_clock_for_smode1(const struct gs_smode1 smode1);
@@ -21,6 +21,36 @@
static struct device *gs_dev;
+/**
+ * gs_region_pal - is the machine for a PAL video mode region?
+ *
+ * See also gs_region_ntsc(). The system region is determined by rom_version(),
+ * which is an approximation because the ROM region does not always correspdond
+ * to the video region.
+ *
+ * Return: %true if PAL video mode is appropriate for the region, else %false
+ */
+bool gs_region_pal(void)
+{
+ return rom_version().region == 'E';
+}
+EXPORT_SYMBOL_GPL(gs_region_pal);
+
+/**
+ * gs_region_ntsc - is the machine for an NTSC video mode region?
+ *
+ * See also gs_region_pal(). The system region is determined by rom_version(),
+ * which is an approximation because the ROM region does not always correspdond
+ * to the video region.
+ *
+ * Return: %true if NTSC video mode is appropriate for the region, else %false
+ */
+bool gs_region_ntsc(void)
+{
+ return !gs_region_pal();
+}
+EXPORT_SYMBOL_GPL(gs_region_ntsc);
+
/**
* gs_video_clock - video clock (VCK) frequency given SMODE1 bit fields
* @t1248 - &gs_smode1.t1248 PLL output divider
PlayStation 2 hardware indicates regions in multiple ways. There are regions for the ROM, discs, CSS, video mode and Magic Gate. Currently only the ROM region is implemented. Signed-off-by: Fredrik Noring <noring@nocrew.org> --- arch/mips/include/asm/mach-ps2/gs.h | 4 ++++ drivers/ps2/gs.c | 30 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+)