| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * ALSA SoC Audio Layer - Rockchip SPDIF transceiver driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2015 Collabora Ltd. |
|---|
| 5 | 6 | * Author: Sjoerd Simons <sjoerd.simons@collabora.co.uk> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #ifndef _ROCKCHIP_SPDIF_H |
|---|
| .. | .. |
|---|
| 18 | 15 | */ |
|---|
| 19 | 16 | #define SPDIF_CFGR_CLK_DIV_SHIFT (16) |
|---|
| 20 | 17 | #define SPDIF_CFGR_CLK_DIV_MASK (0xff << SPDIF_CFGR_CLK_DIV_SHIFT) |
|---|
| 21 | | -#define SPDIF_CFGR_CLK_DIV(x) (x << SPDIF_CFGR_CLK_DIV_SHIFT) |
|---|
| 18 | +#define SPDIF_CFGR_CLK_DIV(x) ((x - 1) << SPDIF_CFGR_CLK_DIV_SHIFT) |
|---|
| 19 | + |
|---|
| 20 | +#define SPDIF_CFGR_CLR_MASK BIT(7) |
|---|
| 21 | +#define SPDIF_CFGR_CLR_EN BIT(7) |
|---|
| 22 | +#define SPDIF_CFGR_CLR_DIS 0 |
|---|
| 23 | + |
|---|
| 24 | +#define SPDIF_CFGR_CSE_MASK BIT(6) |
|---|
| 25 | +#define SPDIF_CFGR_CSE_EN BIT(6) |
|---|
| 26 | +#define SPDIF_CFGR_CSE_DIS 0 |
|---|
| 27 | + |
|---|
| 28 | +#define SPDIF_CFGR_ADJ_MASK BIT(3) |
|---|
| 29 | +#define SPDIF_CFGR_ADJ_LEFT_J BIT(3) |
|---|
| 30 | +#define SPDIF_CFGR_ADJ_RIGHT_J 0 |
|---|
| 22 | 31 | |
|---|
| 23 | 32 | #define SPDIF_CFGR_HALFWORD_SHIFT 2 |
|---|
| 24 | 33 | #define SPDIF_CFGR_HALFWORD_DISABLE (0 << SPDIF_CFGR_HALFWORD_SHIFT) |
|---|
| .. | .. |
|---|
| 59 | 68 | #define SPDIF_INTSR (0x0010) |
|---|
| 60 | 69 | #define SPDIF_XFER (0x0018) |
|---|
| 61 | 70 | #define SPDIF_SMPDR (0x0020) |
|---|
| 71 | +#define SPDIF_VLDFRn(x) (0x0060 + (x) * 4) |
|---|
| 72 | +#define SPDIF_USRDRn(x) (0x0090 + (x) * 4) |
|---|
| 73 | +#define SPDIF_CHNSRn(x) (0x00c0 + (x) * 4) |
|---|
| 74 | +#define SPDIF_VERSION (0x01c0) |
|---|
| 62 | 75 | |
|---|
| 63 | 76 | #endif /* _ROCKCHIP_SPDIF_H */ |
|---|