summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/dev
AgeCommit message (Collapse)Author
2024-10-22put opening { on same line as struct nameJonathan Gray
ok claudio@
2024-09-06spelling; ok mglocker@Jonathan Gray
2024-09-04Fix some spelling.Marcus Glocker
Input and ok jmc@, jsg@
2024-08-28splnet() not needed in activate functionTheo de Raadt
ok gkoehler
2024-05-29indent with tabs not spaces; from jon@elytron.openbsd.amsterdamJonathan Gray
2024-05-28Garbage collect sleep_abort(); it doesn't do anything useful anymore.Mark Kettenis
ok deraadt@, mlarkin@
2024-05-22remove prototypes with no matching function and externs with no varJonathan Gray
2024-04-14with empty body loops, put final semicolon on a new line for readabilityJonathan Gray
ok bluhm@ jca@
2024-03-03Fix awacs(4) audio on some iMac G3 modelsGeorge Koehler
This code affects iMac G3s with a slot-loading CD drive (from late 1999 to 2001, after the older tray-loading iMac G3s, and before the iMac G4s). Detect such iMacs by their model string (PowerMac2,1 or PowerMac2,2 or PowerMac4,1), and configure their headphones and internal speakers in a different way. These iMacs have 3 places to connect headphones (2 on front, 1 on right side). They also have no audio connection to the CD drive, so turn off the noisy CD input. From evan (dot) jss (at) protonmail (dot) ch; I edited the code to get the model string.
2023-12-26Update documentation URLMiod Vallat
2023-11-22Add support for keyboard backlight on Apple Powerbooks.Tobias Heider
From jon (at) elytron (dot) openbsd (dot) amsterdam ok gkoehler@
2023-07-31Implement audio input source selection.Tobias Heider
from jon at elytron dot openbsd dot amsterdam feedback and ok miod@
2023-07-08Adds request_sleep(), a MI way of sending the machine to sleep inTobias Heider
a safe thread. Support is limited to amd64, i386 and arm64 at the moment, macppc gets only an empty stub. feedback from kettenis@ tested by bluhm@ ok phessler@
2023-04-11fix double words in commentsJonathan Gray
feedback and ok jmc@ miod, ok millert@
2023-01-04Gordon W. Ross and Bill Studenmund agreed to rescind clause 3 and 4 inJonathan Gray
NetBSD zs.c rev 1.49 https://mail-index.netbsd.org/source-changes/2009/10/27/msg002419.html
2022-12-28Ansify, fixes clang 15 -Wdeprecated-non-prototype (fatal with -Werror)Jeremie Courreges-Anglas
ok millert@
2022-12-26send_adb_cuda() would assume the returned value of splhigh() is the macintrMiod Vallat
interrupt enable register; this used to be true more than 20 years ago but the interrupt code has changed a lot since, and it is nevertheless bad practice from md drivers to know to much about spl*() return values. The check should become a "spl >= IPL_TTY", but management of the adb_polling variable is good enough to need this at all.
2022-12-26Update adb_polling in akbd_cnpollc rather than akbd_cngetc; repairs ddbMiod Vallat
input on adb machines.
2022-10-26Make audio(9) get_props() optional, remove it from duplex driversKlemens Nanni
The property bits of audio(9) are obsolete and ought to be removed completely. sys/dev/audio.c:audio_open() currently uses get_props() to bail out if read *and* write was requested on a non-duplex driver. Drivers that currently support playing but not recording need adjustment before the API can be cleaned up. Drivers that advertise themselves as full duplex, i.e. those that always return AUDIO_PROP_FULLDUPLEX unconditionally in their get_props() currently always succeed this check. As this is the only property, losen audio_open()'s DIAGNOSTIC check and only do the duplex check if the driver provides get_props(). This allows for simple removal of get_props() from full-duplex drivers without adding any other code or without changing functionality. This includes all audio drivers under sys/dev/pci/ (maestro(4) being the only unfinished exception here). Other drivers as well as the API change can then follow in smaller diffs. This builds on amd64, arm64, i386, macppc and sparc64. amd64 with azalia(4) still plays, records as well as plays and records at the same time on my X230 as tested with $ aucat -i play.wav [-o rec.wav] alpha and hppa tests by miod OK ratchov miod
2022-10-23Constify send/receive command tablesKlemens Nanni
Both only used for printf calls. OK gkoehler
2022-10-23Connect macppc's power button and lid to the SUSPEND stubsGeorge Koehler
A kernel with option SUSPEND now calls gosleep() if I run zzz(8), press the power button (when machdep.pwraction=2), or close the lid (when machdep.lidaction=1). Because gosleep() is an empty stub, the macppc does not really suspend; it only suspends some devices and immediately resumes. The interrupt from the power button or the lid needs some thread (other than systq) to call sleep_state(). Use taskq_create(9) to create another thread. Add a call to device_register_wakeup(). Without this call, sleep_state() does nothing. ok kettenis@ deraadt@
2022-10-21hw.power, machdep.lidaction, machdep.pwraction for macppcGeorge Koehler
I can now use the power button to power off my macppcs running OpenBSD. The new sysctls machdep.lidaction and machdep.pwraction act like acpibtn(4), but we are missing code to suspend or hibernate a macppc. Small kernels (bsd.rd) continue to ignore the power button. adb(4) sends an environment interrupt when I unplug my PowerBook's AC or close its lid. Rename PMU_INT_WAKEUP to PMU_INT_ENVIRONMENT like other BSDs and Linux. Handle PMU_ENV_LID_CLOSED as a lid sensor and PMU_ENV_AC_POWER by setting sysctl hw.power. Power buttons can either use PMU_ENV_POWER_BUTTON or go through akbd(4); handle both kinds of power buttons in the same way. Other models of macppc, with different power buttons or lids, might not work yet. The lid sensor looks like, $ sysctl hw.sensors hw.sensors.adb0.indicator0=On (lid open) kettenis@ warned against calling prsignal() from interrupt context, and pointed me to task_add(9).
2022-10-19Use C99 struct init for struct audio_hw_ifKlemens Nanni
This audio(9) struct will lose a member, but drivers init their struct quite inconsistently, most pre-C99 style. Use C99 style everywhere, to get rid of all annoying differences and allow for easy member removals/additions: - don't change current order of members - no explicit NULL members - no comments or blank lines - trailing comma in last member line GENERIC.MP builds fine with this on arm64, amd64, i386 and sparc64. macppc and alpha build-tested by miod OK ratchov miod
2022-10-18Remove unused AUDIO_PROP_{MMAP,INDEPENDENT}Klemens Nanni
AUDIO_PROP_FULLDUPLEX is the only audio(9) in use, the other two died with commit 1cf2860827c8ca659d8097d8da94a5ae5b888c53 Author: ratchov <ratchov@openbsd.org> Date: Thu Jun 25 06:43:45 2015 +0000 Reimplement the audio driver in a simpler way, removing unused/unusable functionality. Same API and ABI except for the removed bits and no behaviour change for programs using libsndio. With help from armani@ and mpi@, thanks. but remained defined and set in drivers. and the following merely moved them when they were dead code already: commit 9215aa3dfad387bca877a805534df6dcfe8722eb Author: ratchov <ratchov@openbsd.org> Date: Wed Aug 31 07:22:43 2016 +0000 Delete unused ioctls and associated macros. Move macros that are still used internally by low-level drivers from sys/audioio.h to dev/audio_if.h instead of deleting them. None of this is used in base or ports; codesearch.debian.net only shows AUDIO_PROP_{CAPTURE,PLAYBACK} in firefox-esr, mozjs and cubeb. ratchov points out that audio_if.h and audioio.h are private interfaces and the codesearch shows SunOS and NetBSD bits (#ifdef'd out on OpenBSD). OK ratchov
2022-10-15ansiJonathan Gray
2022-09-18Define PMU_ADB_CMD and PMU_INT_ACKGeorge Koehler
Taking these definitions from NetBSD's pm_direct.h; most PMU_* commands have the same names in the BSDs and Linux. ok miod@ kettenis@
2022-07-24macppc, powerpc: retrigger deferred DEC interrupts from splx(9)Scott Soule Cheloha
On PowerPC, by design, you cannot mask decrementer (DEC) interrupts without also masking other interrupts that we want to leave unmasked at or above IPL_CLOCK. So, currently, the DEC is left unmasked, even when we're working at IPL_CLOCK or IPL_HIGH. If a DEC interrupt arrives while we're at those priority levels, the current solution is to postpone any clock interrupt work until the next hardclock(9) or statclock tick. This is a problem for a machine-independent clock interrupt subsystem because the MD code, e.g. decr_intr(), ideally shouldn't need to know anything about when the next event is scheduled to occur. The most obvious solution to this problem that I can think of is to instead postpone clock interrupt work until the next time our priority level drops below IPL_CLOCK. This is something we can do from the MD code without any knowledge of when the next clock interrupt event is scheduled to occur. So: - Add a new boolean, ci_dec_deferred, to the PowerPC cpu_info struct. - If we reach decr_intr() when the CPU's priority level is too high, set ci_dec_deferred, clear the DEC exception, and return. - If we reach decr_intr() and the CPU's priority level is low enough, clear ci_dec_deferred and do any needed clock interrupt work. - In splx(9) (there are three different versions we need to update), check ci_dec_deferred. If it's set and our priority level is dropping below IPL_CLOCK, raise a DEC exception. Tested by me on PowerMac7,3 (openpic). Tested by miod@ on PowerMac1,1 (macintr) (`make build` completes). Tested by gkoehler@ on an unknown PowerMac (probably openpic). With lots of help from kettenis@. ok gkoehler@ miod@
2022-07-02Remove unused device poll functions.Visa Hankala
Also remove unneeded includes of <sys/poll.h> and <sys/select.h>. Some addenda from jsg@. OK miod@ mpi@
2022-04-06constify struct cfattachChristian Weisgerber
2022-03-21Constify struct {audio,midi,radio,video}_hw_if. No functional change.Miod Vallat
ok mpi@ ratchov@ "More const is good" deraadt@
2022-03-13Constify struct cfattach.Martin Pieuchot
ok miod@
2022-02-22Delete unnecessary #includes of <sys/domain.h> and/or <sys/protosw.h>Philip Guenther
net/if_pppx.c pointed out by jsg@ ok gnezdo@ deraadt@ jsg@ mpi@ millert@
2022-02-21interrunts -> interruptsJonathan Gray
2022-02-16change MD gosleep() and sleep_finish() to return int, the MI code will beTheo de Raadt
able to react to this suitably.
2022-02-16Make room for a cookie argument passed to audio_attach_mi(). CurrentlyAnton Lindqvist
unused but intended to be used to correlate audio and wskbd devices. ok ratchov@
2022-02-15Since acpitoshiba brightness button processing no longer plays gamesTheo de Raadt
with AML parsing outside the acpi thread, the locking-release dance around wsdisplay_{suspend,resume} can be removed ok kettenis
2022-02-15when the MI suspend code encounters problems, we need a way toTheo de Raadt
reset the MD state before bailing out. New MD function sleep_abort() does that.
2022-02-15MI disable_lid_wakeups() is not needed, x86 systems can do thisTheo de Raadt
in sleep_resume(), which seems sensible for other future systems also
2022-02-14don't deref pointer before test it is safeJonathan Gray
ok miod@
2022-02-12add MP stubsTheo de Raadt
2022-02-12for non-SUSPEND kernel, put the ioctl pieces entirely inside #ifdefTheo de Raadt
2022-02-11the sleep_clocks() hook is not needed because the architectures whichTheo de Raadt
need to do this can do it a few moments later in a different hook
2022-02-10Add stubs for macppc suspendGeorge Koehler
These stubs don't work; they only pretend to suspend the machine. SUSPEND + MULTIPROCESSOR doesn't build. zzz(8) stops giving an error message, even in no-SUSPEND kernels. Add intr_enable in <powerpc/cpu.h>, adapted from powerpc64, because subr_suspend.c calls intr_enable().
2021-06-23adb(4/macppc): fix adb_cuda_tickle() prototypecheloha
Timeout callback functions are of type void (*)(void *). adb_cuda_tickle() needs a void pointer for a first parameter. ok mpi@
2021-03-26Return EOPNOTSUPP for unsupported ioctlskn
Match what apm(4/macppc) says and make apmd(8) log an approiate warning when unsupported power actions are requested. Merge identical cases while here. This syncs with the apm ioctl handlers on loongson and arm64.
2021-03-11spellingJonathan Gray
2020-12-25Refactor klist insertion and removalVisa Hankala
Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
2020-08-26Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.Visa Hankala
OK deraadt@, mpi@
2020-07-10Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use thePatrick Wildt
"new" API. ok dlg@ tobhe@
2020-06-06Move PowerBook5,4 audio from aoa(4) to snapper(4).gkoehler
This adds the missing TAS3004 volume control. Before, I put my ear near the speaker (to hear audio), because I had no way to turn up the volume. Now, the default volume is much louder, so I use sndioctl(1) to turn it down. Check for the model string "PowerBook5,4". This model's device tree has compatible = "AOAKeylargo" for the audio, doesn't show the TAS3004 in the same way as other models.