From: kernel test robot <lkp@intel.com>
To: Christian Ehrhardt <christian.ehrhardt@codasip.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [scosu-sched:topic/mmap-cap-prot-wip/v6.18 340/1130] drivers/gpu/drm/bridge/tda998x_drv.c:974:12: warning: 'tda998x_derive_cts_n' defined but not used
Date: Thu, 21 May 2026 13:26:51 +0800 [thread overview]
Message-ID: <202605211316.IMuKBDRX-lkp@intel.com> (raw)
tree: https://github.com/scosu/linux-sched topic/mmap-cap-prot-wip/v6.18
head: f69a5a9d9fee15edde28429e23a4c749a59937bd
commit: 88aeac7d0691e6cbf6b17d417b7981bc6c7405fa [340/1130] [CHERRY-PICK] drm: i2c: Include hdmi-codec definitions only when required
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20260521/202605211316.IMuKBDRX-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260521/202605211316.IMuKBDRX-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605211316.IMuKBDRX-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/bridge/tda998x_drv.c:974:12: warning: 'tda998x_derive_cts_n' defined but not used [-Wunused-function]
974 | static int tda998x_derive_cts_n(struct tda998x_priv *priv,
| ^~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/bridge/tda998x_drv.c:894:41: warning: 'tda998x_audio_route' defined but not used [-Wunused-const-variable=]
894 | static const struct tda998x_audio_route tda998x_audio_route[AUDIO_ROUTE_NUM] = {
| ^~~~~~~~~~~~~~~~~~~
vim +/tda998x_derive_cts_n +974 drivers/gpu/drm/bridge/tda998x_drv.c
ad975f9364a3e1be drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2016-10-23 893
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 @894 static const struct tda998x_audio_route tda998x_audio_route[AUDIO_ROUTE_NUM] = {
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 895 [AUDIO_ROUTE_I2S] = {
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 896 .ena_aclk = 1,
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 897 .mux_ap = MUX_AP_SELECT_I2S,
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 898 .aip_clksel = AIP_CLKSEL_AIP_I2S | AIP_CLKSEL_FS_ACLK,
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 899 },
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 900 [AUDIO_ROUTE_SPDIF] = {
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 901 .ena_aclk = 0,
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 902 .mux_ap = MUX_AP_SELECT_SPDIF,
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 903 .aip_clksel = AIP_CLKSEL_AIP_SPDIF | AIP_CLKSEL_FS_FS64SPDIF,
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 904 },
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 905 };
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 906
88aeac7d0691e6cb drivers/gpu/drm/bridge/tda998x_drv.c Christian Ehrhardt 2025-06-11 907 #ifdef CONFIG_SND_SOC_HDMI_CODEC
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 908 /* Configure the TDA998x audio data and clock routing. */
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 909 static int tda998x_derive_routing(struct tda998x_priv *priv,
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 910 struct tda998x_audio_settings *s,
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 911 unsigned int route)
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 912 {
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 913 s->route = &tda998x_audio_route[route];
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 914 s->ena_ap = priv->audio_port_enable[route];
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 915 if (s->ena_ap == 0) {
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 916 dev_err(&priv->hdmi->dev, "no audio configuration found\n");
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 917 return -EINVAL;
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 918 }
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 919
26f7bf1251c70baf drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-03-01 920 return 0;
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 921 }
88aeac7d0691e6cb drivers/gpu/drm/bridge/tda998x_drv.c Christian Ehrhardt 2025-06-11 922 #endif
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 923
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 924 /*
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 925 * The audio clock divisor register controls a divider producing Audio_Clk_Out
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 926 * from SERclk by dividing it by 2^n where 0 <= n <= 5. We don't know what
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 927 * Audio_Clk_Out or SERclk are. We guess SERclk is the same as TMDS clock.
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 928 *
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 929 * It seems that Audio_Clk_Out must be the smallest value that is greater
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 930 * than 128*fs, otherwise audio does not function. There is some suggestion
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 931 * that 126*fs is a better value.
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 932 */
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 933 static u8 tda998x_get_adiv(struct tda998x_priv *priv, unsigned int fs)
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 934 {
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 935 unsigned long min_audio_clk = fs * 128;
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 936 unsigned long ser_clk = priv->tmds_clock * 1000;
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 937 u8 adiv;
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 938
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 939 for (adiv = AUDIO_DIV_SERCLK_32; adiv != AUDIO_DIV_SERCLK_1; adiv--)
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 940 if (ser_clk > min_audio_clk << adiv)
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 941 break;
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 942
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 943 dev_dbg(&priv->hdmi->dev,
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 944 "ser_clk=%luHz fs=%uHz min_aclk=%luHz adiv=%d\n",
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 945 ser_clk, fs, min_audio_clk, adiv);
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 946
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 947 return adiv;
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 948 }
7dad3740aeb71038 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-27 949
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 950 /*
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 951 * In auto-CTS mode, the TDA998x uses a "measured time stamp" counter to
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 952 * generate the CTS value. It appears that the "measured time stamp" is
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 953 * the number of TDMS clock cycles within a number of audio input clock
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 954 * cycles defined by the k and N parameters defined below, in a similar
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 955 * way to that which is set out in the CTS generation in the HDMI spec.
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 956 *
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 957 * tmdsclk ----> mts -> /m ---> CTS
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 958 * ^
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 959 * sclk -> /k -> /N
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 960 *
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 961 * CTS = mts / m, where m is 2^M.
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 962 * /k is a divider based on the K value below, K+1 for K < 4, or 8 for K >= 4
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 963 * /N is a divider based on the HDMI specified N value.
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 964 *
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 965 * This produces the following equation:
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 966 * CTS = tmds_clock * k * N / (sclk * m)
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 967 *
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 968 * When combined with the sink-side equation, and realising that sclk is
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 969 * bclk_ratio * fs, we end up with:
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 970 * k = m * bclk_ratio / 128.
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 971 *
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 972 * Note: S/PDIF always uses a bclk_ratio of 64.
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 973 */
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 @974 static int tda998x_derive_cts_n(struct tda998x_priv *priv,
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 975 struct tda998x_audio_settings *settings,
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 976 unsigned int ratio)
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 977 {
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 978 switch (ratio) {
95db3b255fde4e83 drivers/gpu/drm/i2c/tda998x_drv.c Jyri Sarha 2016-08-09 979 case 16:
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 980 settings->cts_n = CTS_N_M(3) | CTS_N_K(0);
95db3b255fde4e83 drivers/gpu/drm/i2c/tda998x_drv.c Jyri Sarha 2016-08-09 981 break;
95db3b255fde4e83 drivers/gpu/drm/i2c/tda998x_drv.c Jyri Sarha 2016-08-09 982 case 32:
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 983 settings->cts_n = CTS_N_M(3) | CTS_N_K(1);
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 984 break;
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 985 case 48:
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 986 settings->cts_n = CTS_N_M(3) | CTS_N_K(2);
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 987 break;
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 988 case 64:
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 989 settings->cts_n = CTS_N_M(3) | CTS_N_K(3);
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 990 break;
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 991 case 128:
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 992 settings->cts_n = CTS_N_M(0) | CTS_N_K(0);
95db3b255fde4e83 drivers/gpu/drm/i2c/tda998x_drv.c Jyri Sarha 2016-08-09 993 break;
3b28802e37bb1ca1 drivers/gpu/drm/i2c/tda998x_drv.c David Rheinsberg 2013-09-01 994 default:
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 995 dev_err(&priv->hdmi->dev, "unsupported bclk ratio %ufs\n",
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 996 ratio);
95db3b255fde4e83 drivers/gpu/drm/i2c/tda998x_drv.c Jyri Sarha 2016-08-09 997 return -EINVAL;
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 998 }
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 999 return 0;
a03a915b8387286d drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2019-02-22 1000 }
c4c11dd160a8cc98 drivers/gpu/drm/i2c/tda998x_drv.c Russell King 2013-08-14 1001
:::::: The code at line 974 was first introduced by commit
:::::: a03a915b8387286dfd1e7500705124414802ede7 drm/i2c: tda998x: derive CTS_N value from aclk sample rate ratio
:::::: TO: Russell King <rmk+kernel@armlinux.org.uk>
:::::: CC: Russell King <rmk+kernel@armlinux.org.uk>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-05-21 5:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202605211316.IMuKBDRX-lkp@intel.com \
--to=lkp@intel.com \
--cc=christian.ehrhardt@codasip.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.