Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp786376lqs; Fri, 14 Jun 2024 05:55:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW+fmlaZQGYq+XCJHcjlX1J5KhqH0EzkXpXaHc2Icc4UxB1SGS5RTEqvNuxIyBnKtU7b8GdV3kF1F2emUqVL3M+dPppl2RZXU0wh/S6Bw== X-Google-Smtp-Source: AGHT+IHG0K3ErJdLqQXWz+aNRqM90MF5Y3pPIP/EC4VR/Jzq4JHK/FfI/g0M9HskqbbGUXUTwbct X-Received: by 2002:a67:f1cc:0:b0:47c:11ba:fea9 with SMTP id ada2fe7eead31-48dae389798mr2360361137.23.1718369717407; Fri, 14 Jun 2024 05:55:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718369717; cv=pass; d=google.com; s=arc-20160816; b=qCuCxwNVd1NHscA4wEK7xUuf3w+6/NyPobb5OOxJ10QNsOeJEEtaN6OLSPHE2wS+Km xNhlIYvCfOk41u5qAqXNhbthb0J8Eu5dJ+G+QN5WO4iJuWnS11tJFRjy7Hp3Z1wGax/E T1lYxJW9I+G40wrGtzkn0RRDc8HR2tIxQCE5SS/tKy8CbUo1XajmOrCk6+mdqd2s3uPz NBV3JmDuGZYScXxJjNb7ent28n+vF1ZMSVSTB6kJ0wuy/dNTLZCht7muUAn3QHq3185Q 4DHTaqhyKaS45qGFyMs4BLvoXWT1rTGhU9xmxFiIT8lblnEio7JvLWq08dRKStWrl8Th R2YQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=TGUDi25w4Wy8PrwQH04bIY6SwVHvmlcnTQSHgTX6SZs=; fh=1aUV9ZGeYsJFDBWbHE/f5Z5uvt17UwWpf/X+55Ec/bU=; b=bC4CC3TI00Abib/r00tdYgR3EyGW/X5xjqBnR2CO+nqp+Rut4i9Fs7qYsSiCN5iscP 9LgUCsuN2skqjGFvDUV1iQwPUAYqG5EPQPUQXLp+RRNNpMmH62aFKuVU7vAyBIw/Xsd6 AM1zsHWhSa2UrvRHNni+91bJ3Ub0yfPjGUU+5IZ7cmxIZUYyaIQVP3X9XRQaGO/zsRVY 8kzSp/rCHVGjHDOJ8pwoBsNHWZJEqG8Lnx0uz9t4dejbud+LtYlRIh2wN47dHtj+dr0Q XstvG4l0KtrAmP1sAq98aj1aQ6FlctVGlaJ/fGmhaVNdz9FaZWj3NSDxjqrtz8HoItox SNoQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=viyCHidv; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=viyCHidv; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-214920-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214920-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-441f2fe94a9si36591131cf.603.2024.06.14.05.55.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 05:55:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214920-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=viyCHidv; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=viyCHidv; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-214920-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214920-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0DFB11C21A68 for ; Fri, 14 Jun 2024 12:55:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35ADD199EB9; Fri, 14 Jun 2024 12:55:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="viyCHidv"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ZP/JNik0"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="viyCHidv"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ZP/JNik0" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 0AD81195F1D; Fri, 14 Jun 2024 12:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718369709; cv=none; b=ZxemJ/aKCTByUL5nFydKhT8xZCiUgnPjBjSr3Fsxcwf2yDZfCu21+sr0/LIKZDEeRjHFDzfs4BVMHL8PzIrvxmkFHpJcNP/3bZhhp1WO7Tzbl0E3w00S1tjnczo7+TESbNTBVvZ0ve9ZHKMcO6ifaCnX+vuu0/+8gOvjEvjSLS8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718369709; c=relaxed/simple; bh=iVaGy8W6T9mHWV09FW/jEM2EB0wqInQIFp26nT7SuGo=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=CPbtrNCAOHfMADN+JmdHnrwDI20Hg8QQp2qjPRwiFML8r/Kj1xLeBl0l2P++Z6WOFWnnrSWRNq6TJdmd+8BNxlxjgU1TFpsBaPhlCAo2/6w3R03kjJ6PaaBQBX5r4xIkl177N449MppOYcdZeJzwr1IhsFcXMfhcrRFQNmqm66Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=viyCHidv; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=ZP/JNik0; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=viyCHidv; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=ZP/JNik0; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 555323380B; Fri, 14 Jun 2024 12:55:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718369706; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TGUDi25w4Wy8PrwQH04bIY6SwVHvmlcnTQSHgTX6SZs=; b=viyCHidvKG8WizadpgE3JPFzoDPLNhysHZH2521vxDq/M6Kv/+L6rJSK+aCZ5me3yXcqgC 58Aj3vdwGaHATf4MP0GQWfncwLqpb9pa1rJZfYzhB7KFAz/qCmvSAwgmskP2r6IRAf36iz LkKbk+LGHShUSPRFAK24Zc+XNucLwjw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718369706; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TGUDi25w4Wy8PrwQH04bIY6SwVHvmlcnTQSHgTX6SZs=; b=ZP/JNik0MIRN4mwSRactvzFqH1VMb4RsixqM/peSVFDY8O1Ot73WHlY81+47EH8oPrit5P JKXRR0F2LrjAlaCg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718369706; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TGUDi25w4Wy8PrwQH04bIY6SwVHvmlcnTQSHgTX6SZs=; b=viyCHidvKG8WizadpgE3JPFzoDPLNhysHZH2521vxDq/M6Kv/+L6rJSK+aCZ5me3yXcqgC 58Aj3vdwGaHATf4MP0GQWfncwLqpb9pa1rJZfYzhB7KFAz/qCmvSAwgmskP2r6IRAf36iz LkKbk+LGHShUSPRFAK24Zc+XNucLwjw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718369706; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TGUDi25w4Wy8PrwQH04bIY6SwVHvmlcnTQSHgTX6SZs=; b=ZP/JNik0MIRN4mwSRactvzFqH1VMb4RsixqM/peSVFDY8O1Ot73WHlY81+47EH8oPrit5P JKXRR0F2LrjAlaCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2CA6D13AB1; Fri, 14 Jun 2024 12:55:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 5FdPCao9bGaRMgAAD6G6ig (envelope-from ); Fri, 14 Jun 2024 12:55:06 +0000 Date: Fri, 14 Jun 2024 14:55:31 +0200 Message-ID: <875xub8z0c.wl-tiwai@suse.de> From: Takashi Iwai To: bo liu Cc: perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3] ALSA: hda/senarytech: add senarytech codec support In-Reply-To: <20240614031630.61581-1-bo.liu@senarytech.com> References: <20240614031630.61581-1-bo.liu@senarytech.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[99.98%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_FIVE(0.00)[5] X-Spam-Flag: NO X-Spam-Score: -3.30 X-Spam-Level: On Fri, 14 Jun 2024 05:16:30 +0200, bo liu wrote: > > +static void senary_auto_parse_eapd(struct hda_codec *codec) > +{ > + struct senary_spec *spec = codec->spec; > + hda_nid_t nid; > + > + for_each_hda_codec_node(nid, codec) { > + if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) > + continue; > + if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)) > + continue; > + spec->eapds[spec->num_eapds++] = nid; > + if (spec->num_eapds >= ARRAY_SIZE(spec->eapds)) > + break; > + } > + > + /* chips always have more than two EAPDs, we can control EAPD per pin. */ > + spec->dynamic_eapd = 1; So it's a fixed value, and we can drop this flag and the conditionals. Let's clean up the code. thanks, Takashi