Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4811123iog; Wed, 22 Jun 2022 06:23:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tcNm7TG46c8pLjVE0FsGbb83Xdr7amYJeJrKRgnH1ryDa1bFhWPWyhoCq6ilxQ/usxdxEV X-Received: by 2002:a05:6a00:10d4:b0:522:8c31:ec23 with SMTP id d20-20020a056a0010d400b005228c31ec23mr35854313pfu.67.1655904217904; Wed, 22 Jun 2022 06:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655904217; cv=none; d=google.com; s=arc-20160816; b=kOh2jMyDT/hV55NBzS+ig4xaTUA64Zsygbm2oUJ1ra0ahhfKDOKvs0CKRUt9PMs+Y9 /rtvf6oI3ZdI3jp2kormBq9oRzCZju8fbfvLkAnzvyD2loGkblxtxb3M2dfm6OEiNlFu sjEj5Sgv1oWIt+kuZGr+Sv6QlN0fxaiAXDwtv0lN7/sqwr1FqAIUiY+1INZwwCRTWJ+h kFrcel1u0ziEmJqrDt+ZuR+fNOt7wDk0oRXny+GyxMyjPjy5eB6szybWx2a1nSzQX5kE oya7gmmAtXxK19Da0wTl2sBqiFpRsXJvccuy6ebHimwOGjSIP6tfEyRwfyeAzKgg/Uv4 o/ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature:dkim-signature; bh=TPq/PYAfUeArN2v5LZAdETQPOiri6zDleVEOUExbxsM=; b=UPfibl4qEzd6kRRTe5Ao/Il8Q4s7Td7PLEAEPCKNSzZEMBEefdSjQJfr1DDiQYbxWk XoCDQDor6e1ezSaq43zd1tHWnCUof3ca7ExVDfEwc9sL7gDOvw5kxIVGsJTERd3bDDoq AXzcWTltw3lEb75g+Tw4KTEY0D0VvJ0IdFyDfVYIzl8V0+xWpr+18rqQq/Mf79rqDFZZ mNDXsA2OZVqofw52CzCHWqD4sFfaobF8/U8/rnfusmxa99LlQftEkw6ohDVdoJr80cWh AWPShoWa8G57EVSb+/ouweNdGUBKqc0T7D0HGLSLlkATQ4olyVvGoUG6dPC4Pg/pna/i tyGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=iP0LQU0B; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=XaYsgD3x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a17090a420300b001e3022c3e0bsi23152567pjg.30.2022.06.22.06.23.26; Wed, 22 Jun 2022 06:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=iP0LQU0B; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=XaYsgD3x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351878AbiFVNKN (ORCPT + 99 others); Wed, 22 Jun 2022 09:10:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352087AbiFVNKL (ORCPT ); Wed, 22 Jun 2022 09:10:11 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B02816585 for ; Wed, 22 Jun 2022 06:10:07 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BBBDB21B7D; Wed, 22 Jun 2022 13:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1655903405; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TPq/PYAfUeArN2v5LZAdETQPOiri6zDleVEOUExbxsM=; b=iP0LQU0B72dXyEUXeiRd7ei2C5Kw3uGLRK+eFb6ZN2ODd+acmfdbWaQ6QiLCwmyiLlh4pL GCp5xyY4BFgK3gruF61bPHj5cKw8TSN3TC3jJNktrNCHSWfhmhmrComYP5D80zwabefYvB +k0qfsPdES1FcqKrYQWzhiOhBLuNz5Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1655903405; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TPq/PYAfUeArN2v5LZAdETQPOiri6zDleVEOUExbxsM=; b=XaYsgD3xTNr7U669pBlBhguFGCGPn+Eheg6V25EOLcDMQsFShk58TeluQOffovNTBO+y2z +0ZELqC1exxk23BA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8AA4B134A9; Wed, 22 Jun 2022 13:10:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id XZE1Ia0Us2KgKAAAMHmgww (envelope-from ); Wed, 22 Jun 2022 13:10:05 +0000 Date: Wed, 22 Jun 2022 15:10:04 +0200 Message-ID: <87y1xon8sz.wl-tiwai@suse.de> From: Takashi Iwai To: Amadeusz =?ISO-8859-2?Q?S=B3awi=F1ski?= Cc: Vitaly Rodionov , Jaroslav Kysela , Takashi Iwai , Mark Brown , patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Stefan Binding Subject: Re: [PATCH v7 01/14] ALSA: hda: hda_cs_dsp_ctl: Add Library to support CS_DSP ALSA controls In-Reply-To: References: <20220622074653.179078-1-vitalyr@opensource.cirrus.com> <20220622074653.179078-2-vitalyr@opensource.cirrus.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 Jun 2022 10:40:20 +0200, Amadeusz S?awi?ski wrote: > > > +static int hda_cs_dsp_add_kcontrol(struct hda_cs_dsp_coeff_ctl *ctl) > > +{ > > + struct cs_dsp_coeff_ctl *cs_ctl = ctl->cs_ctl; > > + struct snd_kcontrol_new *kcontrol; > > + struct snd_kcontrol *kctl; > > + int ret = 0; > > + > > + if (cs_ctl->len > ADSP_MAX_STD_CTRL_SIZE) { > > + dev_err(cs_ctl->dsp->dev, "Control %s: length %zu exceeds maximum %d\n", ctl->name, > > + cs_ctl->len, ADSP_MAX_STD_CTRL_SIZE); > > + return -EINVAL; > > + } > > + > > + kcontrol = kzalloc(sizeof(*kcontrol), GFP_KERNEL); > > + if (!kcontrol) > > + return -ENOMEM; > > + > > + kcontrol->name = ctl->name; > > + kcontrol->info = hda_cs_dsp_coeff_info; > > + kcontrol->iface = SNDRV_CTL_ELEM_IFACE_MIXER; > > + kcontrol->private_value = (unsigned long)ctl; > > + kcontrol->access = wmfw_convert_flags(cs_ctl->flags); > > + > > + kcontrol->get = hda_cs_dsp_coeff_get; > > + kcontrol->put = hda_cs_dsp_coeff_put; > > + > > + kctl = snd_ctl_new1(kcontrol, NULL); > > Wouldn't > kctl = snd_ctl_new1(kcontrol, ctl); > work instead of > kcontrol->private_value = (unsigned long)ctl; > ... > kctl = snd_ctl_new1(kcontrol, NULL); > ? The second argument to snd_ctl_new1() is set to private_data field, while private_value is taken from snd_kcontrol_new template. Takashi