From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AED18C433E6 for ; Thu, 4 Mar 2021 13:41:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 855B264F42 for ; Thu, 4 Mar 2021 13:41:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241405AbhCDNkg (ORCPT ); Thu, 4 Mar 2021 08:40:36 -0500 Received: from mx2.suse.de ([195.135.220.15]:35398 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241361AbhCDNkF (ORCPT ); Thu, 4 Mar 2021 08:40:05 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7D4DFACBF; Thu, 4 Mar 2021 13:39:24 +0000 (UTC) Date: Thu, 04 Mar 2021 14:39:24 +0100 Message-ID: From: Takashi Iwai To: Vitaly Rodionov Cc: Jaroslav Kysela , Takashi Iwai , , , Subject: Re: [PATCH 2/4] ALSA: hda/cirrus: Add support for CS8409 HDA bridge and CS42L42 companion codec. In-Reply-To: <20210303182959.5322-3-vitalyr@opensource.cirrus.com> References: <20210303182959.5322-1-vitalyr@opensource.cirrus.com> <20210303182959.5322-3-vitalyr@opensource.cirrus.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 03 Mar 2021 19:29:57 +0100, Vitaly Rodionov wrote: > > +static const struct hda_verb cs8409_cs42l42_init_verbs[] = { > + { 0x01, AC_VERB_SET_POWER_STATE, 0x0000 }, /* AFG: D0 */ I guess this power state change is superfluous. The AFG node is already powered up when the codec probe or init is called. > + { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0020 }, /* GPIO 5 out, 3,4 in */ > + { 0x01, AC_VERB_SET_GPIO_DATA, 0x0000 }, /* GPIO data 0 */ > + { 0x01, AC_VERB_SET_GPIO_MASK, 0x003f }, /* Enable GPIO */ Those are handled in spec->gpio_dir, gpio->data and gpio->mask fields. > + { 0x01, AC_VERB_SET_GPIO_WAKE_MASK, 0x0018 }, /* WAKE from GPIO 3,4 */ > + { 0x47, AC_VERB_SET_PROC_STATE, 0x0001 }, /* Enable VPW processing */ > + { 0x47, AC_VERB_SET_COEF_INDEX, 0x0002 }, /* Configure GPIO 6,7 */ > + { 0x47, AC_VERB_SET_PROC_COEF, 0x0080 }, /* I2C mode */ > + { 0x47, AC_VERB_SET_COEF_INDEX, 0x005b }, /* Set I2C bus speed */ > + { 0x47, AC_VERB_SET_PROC_COEF, 0x0200 }, /* 100kHz I2C_STO = 2 */ Those remaining verbs are good in the init verbs. But I suppose they have to be applied at the resume as well? But... > +static int cs8409_cs42l42_fixup(struct hda_codec *codec) > +{ > + int err = 0; > + struct cs_spec *spec = codec->spec; > + unsigned int pincap = 0; > + > + /* Basic initial sequence for specific hw configuration */ > + snd_hda_sequence_write(codec, cs8409_cs42l42_init_verbs); ... it seems applied only at the fixup call at parsing? Ditto about cs8409_cs42l42_hw_init(codec). thanks, Takashi