On Wed, 03 Mar 2021 19:29:57 +0100,Yes, This should be removed
Vitaly Rodionov wrote:
+static const struct hda_verb cs8409_cs42l42_init_verbs[] = {I guess this power state change is superfluous. The AFG node is
+ { 0x01, AC_VERB_SET_POWER_STATE, 0x0000 }, /* AFG: D0 */
already powered up when the codec probe or init is called.
Will handle via spec fields.
+ { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x0020 }, /* GPIO 5 out, 3,4 in */Those are handled in spec->gpio_dir, gpio->data and gpio->mask
+ { 0x01, AC_VERB_SET_GPIO_DATA, 0x0000 }, /* GPIO data 0 */
+ { 0x01, AC_VERB_SET_GPIO_MASK, 0x003f }, /* Enable GPIO */
fields.
This was added in the next patch, but you are right we should handle it here.
+ { 0x01, AC_VERB_SET_GPIO_WAKE_MASK, 0x0018 }, /* WAKE from GPIO 3,4 */Those remaining verbs are good in the init verbs. But I suppose they
+ { 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 */
have to be applied at the resume as well? But...
Yes, needs to be fixed. I will make v2 patch set.
+static int cs8409_cs42l42_fixup(struct hda_codec *codec)... it seems applied only at the fixup call at parsing?
+{
+ 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);
Ditto about cs8409_cs42l42_hw_init(codec).
thanks,
Takashi