Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1710713rdg; Sat, 14 Oct 2023 13:55:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiDLhi7xPY/eLOKBE0/BSJZxxa6WLHeFLJ+8nw4wiJ4dlSCszlfZ8aVre9TneVCYUKlcTF X-Received: by 2002:aca:1b13:0:b0:3ae:2b43:dd4a with SMTP id b19-20020aca1b13000000b003ae2b43dd4amr31341677oib.45.1697316920847; Sat, 14 Oct 2023 13:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697316920; cv=none; d=google.com; s=arc-20160816; b=zs/UCUBt9m3NHJXZPRmoUj4lMbcaZ/Joh8j8datnBNCBf2GXl/xPxifUDg34DeBpb1 CknDfLM7ZF1AEweqkJDbj5X2493ecqU0mzL0u/S2bauEIA3A+axYu/C49RsfuPPT2UWK 5uCEQSfCngscoK9e4NuCKo5OaQYHsIiuZ/ZEXtwDtJ9LJpLrK1hKJcibOQjhZhNmAIxx nw+91wam+bm1R6GRAcht4NSiiysXVxYmERZVyFMxJYs3D7BD+J9AlrPAQU2uZmhcSax1 6TV2bEvQlzRi7u3cpimnAIhyBmi+MuswW8mG2TdGhul2gDlu0YPiKz+0h6d7zlIbr8WM kGOg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=2nXLZgcvDK84RozLr2rRfXB0efNjmc1ATzlgzSv6qVk=; fh=vMwpepDDzWtrlENUcJVlkD39ktIfsR77lZ/cvfNsM4s=; b=bBSsVoWnBAur9yUlc4NTJfiUzQ1Ky9Q5C5sBU1pz5v5HLMz5IxiRx1XubOa0y/U/x5 bBAGI+yed77JYIpSqSl5emWn7QtIX1v5NIObkcK9wPd1Jub+WtFvH2O445wUETdf75Cj moYQxxgmiy/8tpaOJImhkEihZQeZplxjR1OOMjUe2q8zThxoNa7h6nVwa1i3tdWDF9do cc7jvP7mmtpR0agMNwdyrM+1AF/WOif3ntN1cW8z2cZwif7M/ncVnrI4jBuAPZY87rJF nktWNSsa4LvgDzD9kfkDKtK6vBj0nJKk1KDomp5dZvAEgIQRrAsm4++6QWkWJQpKi5dz zwwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NzX+X9dn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id f63-20020a17090a704500b0027902dc4914si2880592pjk.161.2023.10.14.13.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 13:55:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NzX+X9dn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CD095809C3B8; Sat, 14 Oct 2023 13:55:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233300AbjJNUzI (ORCPT + 99 others); Sat, 14 Oct 2023 16:55:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbjJNUzH (ORCPT ); Sat, 14 Oct 2023 16:55:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D88BDC for ; Sat, 14 Oct 2023 13:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697316859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=2nXLZgcvDK84RozLr2rRfXB0efNjmc1ATzlgzSv6qVk=; b=NzX+X9dnh7RVYfE2977XkmPayK0pNB/otbE4ddBRL6VlHx1S2scK8lrNAoJ2tsrVeHk59v Rk40JhFTx/5Nu9YHO6hi54WtSFYcHxvmlREYj917XuxMqnbR7PAX4EA7P/Xxnd5y1Yj7wp vfR1zDVKO/75a0sRaHUJS4R+EOwCbGg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-660-_UuwKgd7MBWYQonL0hPq_g-1; Sat, 14 Oct 2023 16:54:16 -0400 X-MC-Unique: _UuwKgd7MBWYQonL0hPq_g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AFD9F8001EA; Sat, 14 Oct 2023 20:54:15 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEDDB25C0; Sat, 14 Oct 2023 20:54:14 +0000 (UTC) From: Hans de Goede To: Lee Jones Cc: Hans de Goede , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org Subject: [PATCH] mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs Date: Sat, 14 Oct 2023 22:54:14 +0200 Message-ID: <20231014205414.59415-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 14 Oct 2023 13:55:18 -0700 (PDT) Commit 9e86b2ad4c11 changed the channel used for HPDET detection (headphones vs lineout detection) from being hardcoded to ARIZONA_ACCDET_MODE_HPL (HP left channel) to it being configurable through arizona_pdata.hpdet_channel the DT/OF parsing added for filling arizona_pdata on devicetree platforms ensures that arizona_pdata.hpdet_channel gets set to ARIZONA_ACCDET_MODE_HPL when not specified in the devicetree-node. But on ACPI platforms where arizona_pdata is filled by arizona_spi_acpi_probe() arizona_pdata.hpdet_channel was not getting set, causing it to default to 0 aka ARIZONA_ACCDET_MODE_MIC. This causes headphones to get misdetected as line-out on some models. Fix this by setting hpdet_channel = ARIZONA_ACCDET_MODE_HPL. Fixes: e933836744a2 ("mfd: arizona: Add support for ACPI enumeration of WM5102 connected over SPI") Signed-off-by: Hans de Goede --- drivers/mfd/arizona-spi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c index 02cf4f3e91d7..de5d894ac04a 100644 --- a/drivers/mfd/arizona-spi.c +++ b/drivers/mfd/arizona-spi.c @@ -159,6 +159,9 @@ static int arizona_spi_acpi_probe(struct arizona *arizona) arizona->pdata.micd_ranges = arizona_micd_aosp_ranges; arizona->pdata.num_micd_ranges = ARRAY_SIZE(arizona_micd_aosp_ranges); + /* Use left headphone speaker for HP vs line-out detection */ + arizona->pdata.hpdet_channel = ARIZONA_ACCDET_MODE_HPL; + return 0; } -- 2.41.0