]> git.ipfire.org Git - thirdparty/u-boot.git/blame - drivers/sound/i8254_beep.c
Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
[thirdparty/u-boot.git] / drivers / sound / i8254_beep.c
CommitLineData
6a27e540
SG
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2018 Google LLC
4 */
5
d678a59d 6#include <common.h>
6a27e540
SG
7#include <dm.h>
8#include <sound.h>
9#include <asm/i8254.h>
10
11int i8254_start_beep(struct udevice *dev, int frequency_hz)
12{
13 return i8254_enable_beep(frequency_hz);
14}
15
16int i8254_stop_beep(struct udevice *dev)
17{
18 i8254_disable_beep();
19
20 return 0;
21}
22
23static const struct sound_ops i8254_ops = {
24 .start_beep = i8254_start_beep,
25 .stop_beep = i8254_stop_beep,
26};
27
28static const struct udevice_id i8254_ids[] = {
29 { .compatible = "i8254,beeper" },
30 { }
31};
32
33U_BOOT_DRIVER(i8254_drv) = {
34 .name = "i8254_drv",
35 .id = UCLASS_SOUND,
36 .of_match = i8254_ids,
37 .ops = &i8254_ops,
38};