From patchwork Mon Oct 4 09:14:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricard Wanderlof X-Patchwork-Id: 12533549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FB32C433F5 for ; Mon, 4 Oct 2021 09:16:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A78F461216 for ; Mon, 4 Oct 2021 09:16:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A78F461216 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=axis.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 067761687; Mon, 4 Oct 2021 11:15:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 067761687 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633338967; bh=9zj03d7L4yAUa3B6PZKpkHCQHsykAGVa9Tm5cSsXpxE=; h=Date:From:To:Subject:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=Sd3BDjjdH7/We6JOb2G9UKUfZDbv0AnC5IDyqneeZVbGMHHUYJfYOGtwFAULJY7mJ VMP8Saki89Jb5sM4CCcTF4z0XQgg2h8bYkEpm5hI9JwAxzsLpUVRm4ivxUzSntFUU7 ZSWclcMvAzS+84vtfof2r8IBQ7Kgl+G149uteJo4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8A941F80229; Mon, 4 Oct 2021 11:15:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DDE90F80240; Mon, 4 Oct 2021 11:15:14 +0200 (CEST) Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0F8B8F8010B for ; Mon, 4 Oct 2021 11:15:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0F8B8F8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=axis.com header.i=@axis.com header.b="Z9Dq0yHV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1633338909; x=1664874909; h=date:from:to:cc:subject:message-id:mime-version; bh=2EPCh2rpXCko61u0ahKWvUME4wqCIbqBl9yF6BzKUig=; b=Z9Dq0yHVgRU20gtDU87crSAOXAz4qEcfk5GPYCWYblowDb6I4YlJR7vL idBDZmp+JFIf6Mtzmy0uHLohpn/dKTRGiFEPkOUpJrJuZ2hMUy58tG49a HXiw6TsfpcpS5AeAgLG3HWNZe2BycCTBO3C1gsz/NNm07C3n70iXl9OWs ucoztXg5u8kyVuGgPYbPP4ZhwdA+hucKLtPEGGeswibsD+z6OroYyy56t G5O6S4VO0U9lTVpR8pcLWxpXOhKe9Fz8ReAmo+6/6mD68WN+ys7YVSwa7 JKdw5RBNI1qh+LbynXYfKQJqFKwCCr18xE7vUSf62NFWi1vWrks9njdfF Q==; Date: Mon, 4 Oct 2021 11:14:59 +0200 From: Ricard Wanderlof X-X-Sender: ricardw@lnxricardw1.se.axis.com To: Liam Girdwood , Mark Brown Subject: [PATCH 0/2] Codec driver for TLV320ADC3001 and 3101 Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: se-mail04w.axis.com (10.20.40.10) To se-mail07w.axis.com (10.20.40.13) Cc: alsa-devel X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This is a codec driver for the TLV320ADC3001 and TLV320ADC3101 2 channel audio ADC chips from Texas Instruments. Based on an old driver for these chips that I was referred to by Texas Instruments, but which apparently was never upstreamed, I've taken patches from various incarnations, ported them and augmented them with various new features in order to make a working driver. There is currently no support for the on-chip "miniDSP". Although the TLV320ADC3001 and TLV320ADC3101 have similarities with other TI codec chips for which there are existing drivers, upon closer inspection I decided the differences were too great to warrant attempting to modify an existing driver, especially without access to all supported chips and resources for testing them all. There are certainly things that could be improved, among others in the area of PLL register value calculations, but it has been tested on the Axis ARTPEC-8 platform and has been found to work satisfactorily at least with a TLV320ADC3101 operating as an I2S slave at 48 kHz with 32 bit bit depth, 1 or 2 channels, both with the on-chip PLL enabled and disabled. I have not tested this on a TLV320ADC3001 chip, but I've retained the apparent differences from the '3101 (which seem quite small) from the original driver. /Ricard Ricard Wanderlof (2): dt-bindings: sound: tlv320adc3xxx: New codec driver ASoC: codec: tlv320adc3xxx: New codec driver .../bindings/sound/ti,tlv320adc3xxx.yaml | 126 ++ include/dt-bindings/sound/tlv320adc3xxx.h | 33 + sound/soc/codecs/Kconfig | 7 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/tlv320adc3xxx.c | 1239 +++++++++++++++++ sound/soc/codecs/tlv320adc3xxx.h | 381 +++++ 6 files changed, 1788 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/ti,tlv320adc3xxx.yaml create mode 100644 include/dt-bindings/sound/tlv320adc3xxx.h create mode 100644 sound/soc/codecs/tlv320adc3xxx.c create mode 100644 sound/soc/codecs/tlv320adc3xxx.h