Source
// SPDX-License-Identifier: GPL-2.0
/*
* Implementation of per-board codec beeping
* Copyright (c) 2011 The Chromium OS Authors.
* Copyright 2018 Google LLC
*/
/**
* struct hda_regs - HDA registers
*
* https://wiki.osdev.org/Intel_High_Definition_Audio
* https://www.intel.com/content/www/us/en/standards/high-definition-audio-specification.html
*/
struct hda_regs {
u16 gcap;
u8 vmin;
u8 vmaj;
u16 outpay;
u16 inpay;
u32 gctl;
u16 wakeen;
u16 statests;
u8 reserved[0x50];
u32 cmd; /* 0x60 */
u32 resp;
u32 icii;
};
enum {
HDA_ICII_BUSY = BIT(0),
HDA_ICII_VALID = BIT(1),
/* Common node IDs */
HDA_ROOT_NODE = 0x00,
/* HDA verbs fields */
HDA_VERB_NID_S = 20,
HDA_VERB_VERB_S = 8,
HDA_VERB_PARAM_S = 0,
HDA_VERB_GET_PARAMS = 0xf00,
HDA_VERB_SET_BEEP = 0x70a,
/* GET_PARAMS parameter IDs */
GET_PARAMS_NODE_COUNT = 0x04,
GET_PARAMS_AUDIO_GROUP_CAPS = 0x08,
GET_PARAMS_AUDIO_WIDGET_CAPS = 0x09,
/* Sub-node fields */
NUM_SUB_NODES_S = 0,
NUM_SUB_NODES_M = 0xff << NUM_SUB_NODES_S,
FIRST_SUB_NODE_S = 16,
FIRST_SUB_NODE_M = 0xff << FIRST_SUB_NODE_S,