From patchwork Mon Feb 10 15:01:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valerio Setti X-Patchwork-Id: 13967999 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CA6C247DF0 for ; Mon, 10 Feb 2025 15:01:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739199714; cv=none; b=KKmX8mPKE6020Sd6+56y1k7GW00VPovhQ/2ICd9O6yXZf1EvDN15kSe4L4SEAflquGy6x2771gN+0q7k79grd+ype4DzMM61FgNBKa5e1alTxEuw3ISknJEVbLwYw0VNsIAdH5i0Id+l8u7oNKrDK4fpbHXSe0OUosz1zIwBRLE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739199714; c=relaxed/simple; bh=fRXm9P99TfVqw7/aWzdwF95S/kIUYPn5PkUQougaaW8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MtAsgPjUbpjMpjLkj0xIF/8UMTU4BXM7ISKd4wU0Cw2IiXYPHLx3GeYVlB8STPhJMLl9QeJ8LpzO16WMsYgyxbt5KSKPqqJybvUeF8ZwVwMyC95g8DHEM0YSb2xFKgSJ1E2/kFuTGl7R4MbzVkU4Rjw3CqMQ1cA45nJFNzDBVjk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=KpWp80lN; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="KpWp80lN" Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-307d9a13782so39273651fa.2 for ; Mon, 10 Feb 2025 07:01:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1739199710; x=1739804510; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GWn8LoEHwMNZQ9TBj9gyzvn+gEM+LQNUFBCn0O8RbT0=; b=KpWp80lNEQDJq2ZktxgUIIQTTD3mHBjp+ovLSrUZduI6eHbXuqJy2pqfCBKl0JhR4i YrPtYhgIP26GHxD/kemZ6Z0xn8vz8Z6Z8AiNQ5EzS5EHJJgdEIdxl07U/Zndg8/uLHNA Qm1HCxmgXg7k6CiGOpPZe2xTQHzdiajQ9LOM7gGLlmbLRoVaOL4NgJzGIQVJmlrPkyLL iezdsoWBoyVFrOV8MOOOs1rQ5HzfVgV7jLlYBGFceLb1eBTseJfSjhc5nsmuFY42/jlH AQhqw4YiJuMyMP4Pw7VumCnshrU3kQbEK/utIdH9/3AWuyljYVsxLvwB8BxIJNsy/eDp uA/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739199710; x=1739804510; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GWn8LoEHwMNZQ9TBj9gyzvn+gEM+LQNUFBCn0O8RbT0=; b=wdH78HGh3NhksS6Q8PpE3MchtCNqxvrnVjMWUrd6tyZsR/MEejmhgZskSJHvfOAxox qtHdERc6HKw/dMpt704ks6ng/r2Vy/6q6DbN9/WYnE5yydl4B3tpPpTJFrEGFPOyrVMi uFqTMonb98TtbUD8pU1KZkYVyHkQVzu4HmP/ycdu89YgxvTdv6USOWl1I//6jg6YQGgi hcbjphWeKKLlxaQgEbWD2fbsHcZvA3RVyQSGXxtQ9nh4rUo9C10vT0X9brtTYpByM4tT hcl8L4R7Ei3QnIrVS58+pD5974BO/10Y5ObkNw4XhLm8g8vvfKV35m5kIwj66Msf5TIP JcIg== X-Forwarded-Encrypted: i=1; AJvYcCVofr9phW8OW462Pbf0lJjzLlbv8GmrH/Km6v6l07ACOR/rgPPcBVRhSAwt9s2xAOzkPgS+SGaNRY/6/Q==@vger.kernel.org X-Gm-Message-State: AOJu0Yw42oTJ/PHxt9iokxBtq9YrHBfDtWsYqGpSx0qvTRUq6UBxcQo0 YWS7w6WLkWqQYv4fvsmnPTgmE7/nLeHepdc6ClzM+i1NqpYQQIxsm2dEpx6apekf4i1M5yJDoVQ TqNR5mA== X-Gm-Gg: ASbGnctdArG3hya3pmP4q6sc6jE2XB2AO74XVcSTyDqOxt9ToCtbpbk1COcds647r53 DYPslcLg7Io25tzCLDSIJSMdAAl9FZntZxWvZQmgl7FB7GcMdCew7BcqCdvJG20akoQ1oV8miUA Gq9xY868dCeQ4zV+szwb1iS6sjftX5eU8jcE2NDFm7FSJ8bSoDbguvWcGxqTdEeCAOy40+xwxZs zt3tCBmRyuLh5T8JNO5VWSvCiNjhHOljARmCpqteRx+xH4O1bX91wBuFr4yz32QzKM1oSbDRVuf U6MVoMzp39/AHIR/eaBnOyYy+Dkh X-Google-Smtp-Source: AGHT+IEIeHQTJ8/QtRwBWcSl9TO92kHxG7avnOm8/eWBRmULID8JOaosNQ6nHBBvafmVZG0xlTQNtg== X-Received: by 2002:a17:907:6eac:b0:aa6:5910:49af with SMTP id a640c23a62f3a-ab789b1f93cmr1478824566b.24.1739199698834; Mon, 10 Feb 2025 07:01:38 -0800 (PST) Received: from localhost.localdomain ([151.41.218.186]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab7bec717f7sm250400466b.81.2025.02.10.07.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2025 07:01:38 -0800 (PST) From: Valerio Setti To: jbrunet@baylibre.com, neil.armstrong@linaro.org, khilman@baylibre.com, martin.blumenstingl@googlemail.com, linux-amlogic@lists.infradead.org, linux-sound@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Valerio Setti Subject: [PATCH RFC 4/6] ASoC: meson: add support for AUDIN in gx-card Date: Mon, 10 Feb 2025 16:01:27 +0100 Message-Id: <20250210150129.40248-5-vsetti@baylibre.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250210150129.40248-1-vsetti@baylibre.com> References: <20250210150129.40248-1-vsetti@baylibre.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-State: RFC Extend the gx-card module in order to support the audio input capabilities provided by AUDIN driver. Signed-off-by: Valerio Setti --- sound/soc/meson/gx-card.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sound/soc/meson/gx-card.c b/sound/soc/meson/gx-card.c index b408cc2bbc91..c59bb18b0951 100644 --- a/sound/soc/meson/gx-card.c +++ b/sound/soc/meson/gx-card.c @@ -67,7 +67,8 @@ static int gx_card_parse_i2s(struct snd_soc_card *card, static int gx_card_cpu_identify(struct snd_soc_dai_link_component *c, char *match) { - if (of_device_is_compatible(c->of_node, DT_PREFIX "aiu")) { + if ((of_device_is_compatible(c->of_node, DT_PREFIX "aiu")) || + (of_device_is_compatible(c->of_node, DT_PREFIX "audin"))) { if (strstr(c->dai_name, match)) return 1; } @@ -96,6 +97,8 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np, if (gx_card_cpu_identify(dai_link->cpus, "FIFO")) return meson_card_set_fe_link(card, dai_link, np, true); + else if (gx_card_cpu_identify(dai_link->cpus, "TODDR")) + return meson_card_set_fe_link(card, dai_link, np, false); ret = meson_card_set_be_link(card, dai_link, np); if (ret) @@ -107,8 +110,11 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np, dai_link->num_c2c_params = 1; } else { dai_link->no_pcm = 1; - /* Check if the cpu is the i2s encoder and parse i2s data */ - if (gx_card_cpu_identify(dai_link->cpus, "I2S Encoder")) + /* Check if the cpu is the i2s encoder|decoder and parse + * i2s data + */ + if (gx_card_cpu_identify(dai_link->cpus, "I2S Encoder") || + gx_card_cpu_identify(dai_link->cpus, "I2S Decoder")) ret = gx_card_parse_i2s(card, np, index); }