aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-06-26 13:49:50 -0400
committerMike Frysinger <vapier@gentoo.org>2011-07-23 01:18:26 -0400
commit0a7e5413ca17b59d09badc49b3be92e44c47247d (patch)
treee36dab85e2e77980681186755e6a32ce019d76ce
parent82ed5f73eddf72af797bfc2736f9ef4b64316ed4 (diff)
Blackfin: debug-mmrs: generalize pint logic
Don't bind the code to specific CPU defines. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--arch/blackfin/kernel/debug-mmrs.c50
1 files changed, 31 insertions, 19 deletions
diff --git a/arch/blackfin/kernel/debug-mmrs.c b/arch/blackfin/kernel/debug-mmrs.c
index 3ae02965465..92f66482628 100644
--- a/arch/blackfin/kernel/debug-mmrs.c
+++ b/arch/blackfin/kernel/debug-mmrs.c
@@ -323,6 +323,29 @@ bfin_debug_mmrs_hmdma(struct dentry *parent, unsigned long base, int num)
323#define HMDMA(num) bfin_debug_mmrs_hmdma(parent, HMDMA##num##_CONTROL, num) 323#define HMDMA(num) bfin_debug_mmrs_hmdma(parent, HMDMA##num##_CONTROL, num)
324 324
325/* 325/*
326 * Peripheral Interrupts (PINT/GPIO)
327 */
328#ifdef PINT0_MASK_SET
329#define __PINT(uname, lname) __REGS(pint, #uname, lname)
330static void __init __maybe_unused
331bfin_debug_mmrs_pint(struct dentry *parent, unsigned long base, int num)
332{
333 char buf[32], *_buf = REGS_STR_PFX(buf, PINT, num);
334 __PINT(MASK_SET, mask_set);
335 __PINT(MASK_CLEAR, mask_clear);
336 __PINT(REQUEST, request);
337 __PINT(ASSIGN, assign);
338 __PINT(EDGE_SET, edge_set);
339 __PINT(EDGE_CLEAR, edge_clear);
340 __PINT(INVERT_SET, invert_set);
341 __PINT(INVERT_CLEAR, invert_clear);
342 __PINT(PINSTATE, pinstate);
343 __PINT(LATCH, latch);
344}
345#define PINT(num) bfin_debug_mmrs_pint(parent, PINT##num##_MASK_SET, num)
346#endif
347
348/*
326 * Port/GPIO 349 * Port/GPIO
327 */ 350 */
328#define bfin_gpio_regs gpio_port_t 351#define bfin_gpio_regs gpio_port_t
@@ -1270,6 +1293,14 @@ static int __init bfin_debug_mmrs_init(void)
1270 D32(OTP_DATA3); 1293 D32(OTP_DATA3);
1271#endif 1294#endif
1272 1295
1296#ifdef PINT0_MASK_SET
1297 parent = debugfs_create_dir("pint", top);
1298 PINT(0);
1299 PINT(1);
1300 PINT(2);
1301 PINT(3);
1302#endif
1303
1273#ifdef PIXC_CTL 1304#ifdef PIXC_CTL
1274 parent = debugfs_create_dir("pixc", top); 1305 parent = debugfs_create_dir("pixc", top);
1275 D16(PIXC_CTL); 1306 D16(PIXC_CTL);
@@ -1833,7 +1864,6 @@ static int __init bfin_debug_mmrs_init(void)
1833 { 1864 {
1834 int num; 1865 int num;
1835 unsigned long base; 1866 unsigned long base;
1836 char *_buf, buf[32];
1837 1867
1838 base = PORTA_FER; 1868 base = PORTA_FER;
1839 for (num = 0; num < 10; ++num) { 1869 for (num = 0; num < 10; ++num) {
@@ -1841,24 +1871,6 @@ static int __init bfin_debug_mmrs_init(void)
1841 base += sizeof(struct bfin_gpio_regs); 1871 base += sizeof(struct bfin_gpio_regs);
1842 } 1872 }
1843 1873
1844#define __PINT(uname, lname) __REGS(pint, #uname, lname)
1845 parent = debugfs_create_dir("pint", top);
1846 base = PINT0_MASK_SET;
1847 for (num = 0; num < 4; ++num) {
1848 _buf = REGS_STR_PFX(buf, PINT, num);
1849 __PINT(MASK_SET, mask_set);
1850 __PINT(MASK_CLEAR, mask_clear);
1851 __PINT(REQUEST, request);
1852 __PINT(ASSIGN, assign);
1853 __PINT(EDGE_SET, edge_set);
1854 __PINT(EDGE_CLEAR, edge_clear);
1855 __PINT(INVERT_SET, invert_set);
1856 __PINT(INVERT_CLEAR, invert_clear);
1857 __PINT(PINSTATE, pinstate);
1858 __PINT(LATCH, latch);
1859 base += sizeof(struct bfin_pint_regs);
1860 }
1861
1862 } 1874 }
1863#endif /* BF54x */ 1875#endif /* BF54x */
1864 1876