From 9f0fc191371843c4fc000a226b0a26b6c059aacd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 19:40:19 +0200 Subject: Merging upstream version 6.7.7. Signed-off-by: Daniel Baumann --- arch/m68k/mac/baboon.c | 2 ++ arch/m68k/mac/config.c | 14 +++----------- arch/m68k/mac/iop.c | 2 ++ arch/m68k/mac/mac.h | 25 +++++++++++++++++++++++++ arch/m68k/mac/macboing.c | 11 ++--------- arch/m68k/mac/misc.c | 5 +++-- arch/m68k/mac/oss.c | 2 ++ arch/m68k/mac/psc.c | 2 ++ arch/m68k/mac/via.c | 2 ++ 9 files changed, 43 insertions(+), 22 deletions(-) create mode 100644 arch/m68k/mac/mac.h (limited to 'arch/m68k/mac') diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index a7d2802206..5c97a7058b 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c @@ -15,6 +15,8 @@ #include #include +#include "mac.h" + int baboon_present; static volatile struct baboon *baboon; diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 382f656c29..e324410ef2 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -50,22 +50,14 @@ #include #include +#include "mac.h" + /* Mac bootinfo struct */ struct mac_booter_data mac_bi_data; /* The phys. video addr. - might be bogus on some machines */ static unsigned long mac_orig_videoaddr; -extern int mac_hwclk(int, struct rtc_time *); -extern void iop_init(void); -extern void via_init(void); -extern void via_init_clock(void); -extern void oss_init(void); -extern void psc_init(void); -extern void baboon_init(void); - -extern void mac_mksound(unsigned int, unsigned int); - static void mac_get_model(char *str); static void mac_identify(void); static void mac_report_hardware(void); @@ -958,7 +950,7 @@ static const struct pata_platform_info mac_pata_data __initconst = { .ioport_shift = 2, }; -int __init mac_platform_init(void) +static int __init mac_platform_init(void) { phys_addr_t swim_base = 0; diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index 010b3b5ae8..a92740d530 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -119,6 +119,8 @@ #include #include +#include "mac.h" + #ifdef DEBUG #define iop_pr_debug(fmt, ...) \ printk(KERN_DEBUG "%s: " fmt, __func__, ##__VA_ARGS__) diff --git a/arch/m68k/mac/mac.h b/arch/m68k/mac/mac.h new file mode 100644 index 0000000000..d3d142cea3 --- /dev/null +++ b/arch/m68k/mac/mac.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +struct rtc_time; + +/* baboon.c */ +void baboon_init(void); + +/* iop.c */ +void iop_init(void); + +/* misc.c */ +int mac_hwclk(int op, struct rtc_time *t); + +/* macboing.c */ +void mac_mksound(unsigned int freq, unsigned int length); + +/* oss.c */ +void oss_init(void); + +/* psc.c */ +void psc_init(void); + +/* via.c */ +void via_init(void); +void via_init_clock(void); diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c index 4de6229c7b..faea2265a5 100644 --- a/arch/m68k/mac/macboing.c +++ b/arch/m68k/mac/macboing.c @@ -16,21 +16,14 @@ #include #include +#include "mac.h" + static int mac_asc_inited; /* * dumb triangular wave table */ static __u8 mac_asc_wave_tab[ 0x800 ]; -/* - * Alan's original sine table; needs interpolating to 0x800 - * (hint: interpolate or hardwire [0 -> Pi/2[, it's symmetric) - */ -static const signed char sine_data[] = { - 0, 39, 75, 103, 121, 127, 121, 103, 75, 39, - 0, -39, -75, -103, -121, -127, -121, -103, -75, -39 -}; - /* * where the ASC hides ... */ diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index c7cb29f0ff..4c8f8cbfa0 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -25,6 +25,8 @@ #include +#include "mac.h" + /* * Offset between Unix time (1970-based) and Mac time (1904-based). Cuda and PMU * times wrap in 2040. If we need to handle later times, the read_time functions @@ -554,7 +556,7 @@ static void unmktime(time64_t time, long offset, /* Leap years. */ { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }; - int days, rem, y, wday, yday; + int days, rem, y, wday; const unsigned short int *ip; days = div_u64_rem(time, SECS_PER_DAY, &rem); @@ -592,7 +594,6 @@ static void unmktime(time64_t time, long offset, y = yg; } *yearp = y - 1900; - yday = days; /* day in the year. Not currently used. */ ip = __mon_yday[__isleap(y)]; for (y = 11; days < (long int) ip[y]; --y) continue; diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index 921e6c092f..1641607f30 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c @@ -27,6 +27,8 @@ #include #include +#include "mac.h" + int oss_present; volatile struct mac_oss *oss; diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index 0d0965b19c..b4183cf66e 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c @@ -26,6 +26,8 @@ #include #include +#include "mac.h" + #define DEBUG_PSC volatile __u8 *psc; diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 3d11d6219c..01e6b0e37f 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c @@ -38,6 +38,8 @@ #include #include +#include "mac.h" + volatile __u8 *via1, *via2; int rbv_present; int via_alt_mapping; -- cgit v1.2.3