Received: by 10.223.176.5 with SMTP id f5csp1628997wra; Thu, 8 Feb 2018 00:27:26 -0800 (PST) X-Google-Smtp-Source: AH8x227YjhFpfYbs5L2AL+9Oka3O8etvcoVBYjx830NJ3nX1cjJRNDs4aBk1U/DGhywG9TQ0+EB/ X-Received: by 10.98.195.2 with SMTP id v2mr8570737pfg.141.1518078446166; Thu, 08 Feb 2018 00:27:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518078446; cv=none; d=google.com; s=arc-20160816; b=C4QGDcwnWTcBCkekULGJ41Y5PdgBX05yPc76SglM/FjhxZZcatPzHlTc7AiFGmGGfE a36jhzSdtvXiDubuSuic8WbqfdF1tMfYoxVOC9w8tpFFaeMdtlIYuB9ffXlvynNPU0g3 eFagqpY5GxIXtoSGSmnjsKaq2CRQnwgtGWXsi95UBPbK0p0u8dzVw43gjECHNKu/a3TC xET7NMqjq7/MZhsFQW2zBCKThMyx688KSayPU6ViXW8zm7zL+OCZYqWK5adDuKNlRIfW vq+FnhOZOxKrS0TjWnmLHCmaZra79sbXJVTndot2tflsiME54xUb8kCPVeNUBBbVmp3y sdGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=HQa/03KQCzkxknZ7g07Qxqlvv3QJzayoaOmoUuCb5pw=; b=f1AW6u0Z6/1rTmLxalgrm3Sm83Dt4WxPrzs0Y70mVFzKnuiC+k1OzLyaRqZ9maFjd1 Z6qqGzII1a/ZENL3nuwZoqSyRWItI6YDCo5rjaKgrZ3qvU66HxtJ4d1q0qNzGqhEgc1t 3UI4nxAKuKjvRvKZPL/BAcV7j0DYyR5BgX49fliI1fWuCcjJAkb9lj7TgpjHm7TYnxht +sX4gB6xGT9nP/kUx9jECM9eg+JwbMwU9lU5GcIaeqK8htA4dmlx5rK8RSwNp4tid0EP AvhEez4dVyylTI4QVB2PX8AYUjy6cB6TUM1S5jNV5rWHH+I8n/YNAt7Doi953eEEnQPd 4/HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=0Uyk4pqw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si943461pgp.680.2018.02.08.00.27.11; Thu, 08 Feb 2018 00:27:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=0Uyk4pqw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751319AbeBHI03 (ORCPT + 99 others); Thu, 8 Feb 2018 03:26:29 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35593 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881AbeBHI00 (ORCPT ); Thu, 8 Feb 2018 03:26:26 -0500 Received: by mail-wr0-f196.google.com with SMTP id w50so3756948wrc.2 for ; Thu, 08 Feb 2018 00:26:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=HQa/03KQCzkxknZ7g07Qxqlvv3QJzayoaOmoUuCb5pw=; b=0Uyk4pqw07D2YBpRIDki0MaIJ2wuT5jabUZNDsp3k0/o6j4O6W2cjFFNt2e0o8ZNC+ QymkEjEw+Rw/hrKe4y5EEkyLFApDNnkg1g/Cs/TSwYKaPV3ON5rrOhX3gmdfH+mx2TtY Iv4nhLbbsU4XkLrdcICg9V7MkRbzjnnXCoy34YlD7bwL/u+ud6FXFy5+3XwEqomHslQj 8El8r6OXSJjp0PkfavH0zfno40Teev9a+4VgMhEFy4RROmGbmtgIWpp4FoLiLhY/UyUM 0fvr1wGZB1Y7Azw+MFunIjanKw7yQvxMzJddd9d8nSAMpgcWr7BNAbFEhGVtUTk6XUAK VcnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HQa/03KQCzkxknZ7g07Qxqlvv3QJzayoaOmoUuCb5pw=; b=FlBiNpmIpr1FP1txa1UVniKZXGFo9Ekzu6x9Wkk0brzO0/pRFSRmN78psLwq04q85u 6M3w9Z5aHXEq5k8cWLGfqhbvX35tKHLASgrbVz2BUXBtdGRsbSGsuAW9xLUWQ1xaT77h VQGveHocvWkIKXF7AOmQ6CJBV74PPy2aSQBJzAoBL64kjy1RQ01nZvjrRi9ezKJPcguw 44dViP94Iy7xKHF7mXOAJKLJ7w4X1cp6Ahp0TUAaQbBJ7yogSAUSdk2M8+LdqZsqLTv5 Cx8xDEABTdtyCEtKToSbmI6fvz/T7PrcswCzVoBLwdPJUlqMSOZOhmEZlsvYF07XPb// urgg== X-Gm-Message-State: APf1xPCJRa0MPWIerzQIJlXPYN9ySPkdLSB4sY9spLEBWBRjTnNIcu79 YDh6ksv1yrZiB3RehHxnN72Rhg== X-Received: by 10.223.154.110 with SMTP id z101mr8519760wrb.282.1518078385555; Thu, 08 Feb 2018 00:26:25 -0800 (PST) Received: from localhost.localdomain ([51.15.160.169]) by smtp.googlemail.com with ESMTPSA id p29sm5346889wmf.9.2018.02.08.00.26.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Feb 2018 00:26:24 -0800 (PST) From: Corentin Labbe To: awalls@md.metrocast.net, mchehab@kernel.org Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Corentin Labbe Subject: [PATCH] media: cx18: remove unused cx18-alsa-mixer Date: Thu, 8 Feb 2018 08:26:14 +0000 Message-Id: <1518078374-4150-1-git-send-email-clabbe@baylibre.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cx18-alsa-mixer functions are not used since commit 4cb565cc2700 ("V4L/DVB: cx18: make it so cx18-alsa-main.c compiles") 9 year later, lets just remove them. Signed-off-by: Corentin Labbe --- drivers/media/pci/cx18/cx18-alsa-main.c | 1 - drivers/media/pci/cx18/cx18-alsa-mixer.c | 170 ------------------------------- drivers/media/pci/cx18/cx18-alsa-mixer.h | 18 ---- 3 files changed, 189 deletions(-) delete mode 100644 drivers/media/pci/cx18/cx18-alsa-mixer.c delete mode 100644 drivers/media/pci/cx18/cx18-alsa-mixer.h diff --git a/drivers/media/pci/cx18/cx18-alsa-main.c b/drivers/media/pci/cx18/cx18-alsa-main.c index 2531e4b81b60..93443d1457c5 100644 --- a/drivers/media/pci/cx18/cx18-alsa-main.c +++ b/drivers/media/pci/cx18/cx18-alsa-main.c @@ -32,7 +32,6 @@ #include "cx18-driver.h" #include "cx18-version.h" #include "cx18-alsa.h" -#include "cx18-alsa-mixer.h" #include "cx18-alsa-pcm.h" int cx18_alsa_debug; diff --git a/drivers/media/pci/cx18/cx18-alsa-mixer.c b/drivers/media/pci/cx18/cx18-alsa-mixer.c deleted file mode 100644 index cb04c3d820e2..000000000000 --- a/drivers/media/pci/cx18/cx18-alsa-mixer.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * ALSA mixer controls for the - * ALSA interface to cx18 PCM capture streams - * - * Copyright (C) 2009 Andy Walls - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include "cx18-alsa.h" -#include "cx18-driver.h" - -/* - * Note the cx18-av-core volume scale is funny, due to the alignment of the - * scale with another chip's range: - * - * v4l2_control value /512 indicated dB actual dB reg 0x8d4 - * 0x0000 - 0x01ff 0 -119 -96 228 - * 0x0200 - 0x02ff 1 -118 -96 228 - * ... - * 0x2c00 - 0x2dff 22 -97 -96 228 - * 0x2e00 - 0x2fff 23 -96 -96 228 - * 0x3000 - 0x31ff 24 -95 -95 226 - * ... - * 0xee00 - 0xefff 119 0 0 36 - * ... - * 0xfe00 - 0xffff 127 +8 +8 20 - */ -static inline int dB_to_cx18_av_vol(int dB) -{ - if (dB < -96) - dB = -96; - else if (dB > 8) - dB = 8; - return (dB + 119) << 9; -} - -static inline int cx18_av_vol_to_dB(int v) -{ - if (v < (23 << 9)) - v = (23 << 9); - else if (v > (127 << 9)) - v = (127 << 9); - return (v >> 9) - 119; -} - -static int snd_cx18_mixer_tv_vol_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) -{ - uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; - uinfo->count = 1; - /* We're already translating values, just keep this control in dB */ - uinfo->value.integer.min = -96; - uinfo->value.integer.max = 8; - uinfo->value.integer.step = 1; - return 0; -} - -static int snd_cx18_mixer_tv_vol_get(struct snd_kcontrol *kctl, - struct snd_ctl_elem_value *uctl) -{ - struct snd_cx18_card *cxsc = snd_kcontrol_chip(kctl); - struct cx18 *cx = to_cx18(cxsc->v4l2_dev); - struct v4l2_control vctrl; - int ret; - - vctrl.id = V4L2_CID_AUDIO_VOLUME; - vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]); - - snd_cx18_lock(cxsc); - ret = v4l2_g_ctrl(cx->sd_av->ctrl_handler, &vctrl); - snd_cx18_unlock(cxsc); - - if (!ret) - uctl->value.integer.value[0] = cx18_av_vol_to_dB(vctrl.value); - return ret; -} - -static int snd_cx18_mixer_tv_vol_put(struct snd_kcontrol *kctl, - struct snd_ctl_elem_value *uctl) -{ - struct snd_cx18_card *cxsc = snd_kcontrol_chip(kctl); - struct cx18 *cx = to_cx18(cxsc->v4l2_dev); - struct v4l2_control vctrl; - int ret; - - vctrl.id = V4L2_CID_AUDIO_VOLUME; - vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]); - - snd_cx18_lock(cxsc); - - /* Fetch current state */ - ret = v4l2_g_ctrl(cx->sd_av->ctrl_handler, &vctrl); - - if (ret || - (cx18_av_vol_to_dB(vctrl.value) != uctl->value.integer.value[0])) { - - /* Set, if needed */ - vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]); - ret = v4l2_s_ctrl(cx->sd_av->ctrl_handler, &vctrl); - if (!ret) - ret = 1; /* Indicate control was changed w/o error */ - } - snd_cx18_unlock(cxsc); - - return ret; -} - - -/* This is a bit of overkill, the slider is already in dB internally */ -static DECLARE_TLV_DB_SCALE(snd_cx18_mixer_tv_vol_db_scale, -9600, 100, 0); - -static struct snd_kcontrol_new snd_cx18_mixer_tv_vol __initdata = { - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, - .name = "Analog TV Capture Volume", - .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | - SNDRV_CTL_ELEM_ACCESS_TLV_READ, - .info = snd_cx18_mixer_tv_volume_info, - .get = snd_cx18_mixer_tv_volume_get, - .put = snd_cx18_mixer_tv_volume_put, - .tlv.p = snd_cx18_mixer_tv_vol_db_scale -}; - -/* FIXME - add mute switch and balance, bass, treble sliders: - V4L2_CID_AUDIO_MUTE - - V4L2_CID_AUDIO_BALANCE - - V4L2_CID_AUDIO_BASS - V4L2_CID_AUDIO_TREBLE -*/ - -/* FIXME - add stereo, lang1, lang2, mono menu */ -/* FIXME - add CS5345 I2S volume for HVR-1600 */ - -int __init snd_cx18_mixer_create(struct snd_cx18_card *cxsc) -{ - struct v4l2_device *v4l2_dev = cxsc->v4l2_dev; - struct snd_card *sc = cxsc->sc; - int ret; - - strlcpy(sc->mixername, "CX23418 Mixer", sizeof(sc->mixername)); - - ret = snd_ctl_add(sc, snd_ctl_new1(&snd_cx18_mixer_tv_vol, cxsc)); - if (ret) { - CX18_ALSA_WARN("%s: failed to add %s control, err %d\n", - __func__, snd_cx18_mixer_tv_vol.name, ret); - } - return ret; -} diff --git a/drivers/media/pci/cx18/cx18-alsa-mixer.h b/drivers/media/pci/cx18/cx18-alsa-mixer.h deleted file mode 100644 index 3aed123955dd..000000000000 --- a/drivers/media/pci/cx18/cx18-alsa-mixer.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * ALSA mixer controls for the - * ALSA interface to cx18 PCM capture streams - * - * Copyright (C) 2009 Andy Walls - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -int __init snd_cx18_mixer_create(struct snd_cx18_card *cxsc); -- 2.13.6