From patchwork Wed Feb 23 13:31:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 1596669 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MmPBzUr3; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4K3cQm6Vsbz9sGZ for ; Thu, 24 Feb 2022 00:32:16 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235189AbiBWNcm (ORCPT ); Wed, 23 Feb 2022 08:32:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239491AbiBWNck (ORCPT ); Wed, 23 Feb 2022 08:32:40 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9E296AB460 for ; Wed, 23 Feb 2022 05:32:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645623132; 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: in-reply-to:in-reply-to:references:references; bh=yRCbM22renqYP7o3spvVr/K44KCHTnSuAYlIHartXBE=; b=MmPBzUr3anUJV2/qpGG+NClhKNT/gLmmFvkck7JM8yzCqaqq0fQvucovVGXwNjfq/mT/Ye FNncGZ4FzpJr4xl+6zV3clZzsD/2zVAQ1bphi4+q4v1UR17Jd72ptJ/sg7e5YOs4jU171L ENavEmAillGd67EpwDmvTBseptxE3X4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-xqxHnUP5P-SAFrCnWR2TFA-1; Wed, 23 Feb 2022 08:32:09 -0500 X-MC-Unique: xqxHnUP5P-SAFrCnWR2TFA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 77832800422; Wed, 23 Feb 2022 13:32:08 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.195.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 028D2832AF; Wed, 23 Feb 2022 13:32:06 +0000 (UTC) From: Hans de Goede To: Mark Gross , Andy Shevchenko , Mika Westerberg , Linus Walleij Cc: Hans de Goede , platform-driver-x86@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH 1/5] pinctrl: baytrail: Add pinconf group + function for the pmu_clk Date: Wed, 23 Feb 2022 14:31:49 +0100 Message-Id: <20220223133153.730337-2-hdegoede@redhat.com> In-Reply-To: <20220223133153.730337-1-hdegoede@redhat.com> References: <20220223133153.730337-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-gpio@vger.kernel.org On the Lenovo Yoga Tablet 2 830 / 1050 / 1051 models the 32KHz PMU clk, which can be muxed externally to SUS pin 5 and/or 6 is used as a clock for the audio codec. On the 830 and 1050 models, with ship with Android as factory OS the pin-muxing for this is not setup by the BIOS. Add a pinconf group + function for the pmu_clk on SUS pin 5 and 6 to allow setting the pinmux up from within the x86-android-tablets platform code. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-baytrail.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index 7ae71152b480..fec888c1cd05 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -444,6 +444,9 @@ static const unsigned int byt_sus_pcu_spi_pins[] = { 21 }; static const unsigned int byt_sus_pcu_spi_mode_values[] = { 0 }; static const unsigned int byt_sus_pcu_spi_gpio_mode_values[] = { 1 }; +static const unsigned int byt_sus_pmu_clk1_pins[] = { 5 }; +static const unsigned int byt_sus_pmu_clk2_pins[] = { 6 }; + static const struct intel_pingroup byt_sus_groups[] = { PIN_GROUP("usb_oc_grp", byt_sus_usb_over_current_pins, byt_sus_usb_over_current_mode_values), PIN_GROUP("usb_ulpi_grp", byt_sus_usb_ulpi_pins, byt_sus_usb_ulpi_mode_values), @@ -451,20 +454,26 @@ static const struct intel_pingroup byt_sus_groups[] = { PIN_GROUP("usb_oc_grp_gpio", byt_sus_usb_over_current_pins, byt_sus_usb_over_current_gpio_mode_values), PIN_GROUP("usb_ulpi_grp_gpio", byt_sus_usb_ulpi_pins, byt_sus_usb_ulpi_gpio_mode_values), PIN_GROUP("pcu_spi_grp_gpio", byt_sus_pcu_spi_pins, byt_sus_pcu_spi_gpio_mode_values), + PIN_GROUP("pmu_clk1_grp", byt_sus_pmu_clk1_pins, 1), + PIN_GROUP("pmu_clk2_grp", byt_sus_pmu_clk2_pins, 1), }; static const char * const byt_sus_usb_groups[] = { "usb_oc_grp", "usb_ulpi_grp", }; static const char * const byt_sus_spi_groups[] = { "pcu_spi_grp" }; +static const char * const byt_sus_pmu_clk_groups[] = { + "pmu_clk1_grp", "pmu_clk2_grp" }; static const char * const byt_sus_gpio_groups[] = { "usb_oc_grp_gpio", "usb_ulpi_grp_gpio", "pcu_spi_grp_gpio", + "pmu_clk1_grp", "pmu_clk2_grp", }; static const struct intel_function byt_sus_functions[] = { FUNCTION("usb", byt_sus_usb_groups), FUNCTION("spi", byt_sus_spi_groups), FUNCTION("gpio", byt_sus_gpio_groups), + FUNCTION("pmu_clk", byt_sus_pmu_clk_groups), }; static const struct intel_community byt_sus_communities[] = { From patchwork Wed Feb 23 13:31:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 1596668 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cwdgr6WL; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4K3cQm3L5Zz9sGY for ; Thu, 24 Feb 2022 00:32:16 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239155AbiBWNcl (ORCPT ); Wed, 23 Feb 2022 08:32:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235189AbiBWNck (ORCPT ); Wed, 23 Feb 2022 08:32:40 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 92BC5AB454 for ; Wed, 23 Feb 2022 05:32:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645623132; 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: in-reply-to:in-reply-to:references:references; bh=ARmOV6UfVJ4llIeXOFo21Jm0uKYOJxAZfmOH8IuHdU8=; b=cwdgr6WLJVY/wuHVxGxY8J3/t5gXowRWi/PSNe8ZR05RHB+35JFFMhOG8353e4iEXR0HRW IurpsNim7Xrb7QriP2P24T4vHsPZnlskwibxiLGbs1br0Lr+G0Pug6spmLD1QThYONaZjI k+2TXMdXRy1bfCfL3cEZj4+ihsgNu6k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-107-BKfVl1mtPf2xU8w5do8Gmw-1; Wed, 23 Feb 2022 08:32:11 -0500 X-MC-Unique: BKfVl1mtPf2xU8w5do8Gmw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 35462805742; Wed, 23 Feb 2022 13:32:10 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.195.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1120832A4; Wed, 23 Feb 2022 13:32:08 +0000 (UTC) From: Hans de Goede To: Mark Gross , Andy Shevchenko , Mika Westerberg , Linus Walleij Cc: Hans de Goede , platform-driver-x86@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH 2/5] platform/x86: x86-android-tablets: Fix EBUSY error when requesting IOAPIC IRQs Date: Wed, 23 Feb 2022 14:31:50 +0100 Message-Id: <20220223133153.730337-3-hdegoede@redhat.com> In-Reply-To: <20220223133153.730337-1-hdegoede@redhat.com> References: <20220223133153.730337-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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-gpio@vger.kernel.org Sometimes IRQs used by GPIOs in direct-IRQ mode are already registered because they are used as ACPI "Interrupt () {}" resource for one of the many bogus I2C devices present in the broken DSDTs of Android x86 tablets. This is an issue if the existing (bogus) ACPI resource uses different trigger settings then what is being requested, leading to an -EBUSY error return of acpi_register_gsi(). Fix this by calling acpi_unregister_gsi() first, so that the acpi_register_gsi() is allowed to change the trigger settings. In cases where the GSI has not been registered yet the acpi_unregister_gsi() is a no-op. Signed-off-by: Hans de Goede --- drivers/platform/x86/x86-android-tablets.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c index f280c82d5ba5..61e526e048c3 100644 --- a/drivers/platform/x86/x86-android-tablets.c +++ b/drivers/platform/x86/x86-android-tablets.c @@ -89,6 +89,12 @@ static int x86_acpi_irq_helper_get(const struct x86_acpi_irq_data *data) switch (data->type) { case X86_ACPI_IRQ_TYPE_APIC: + /* + * The DSDT may already reference the GSI in a device skipped by + * acpi_quirk_skip_i2c_client_enumeration(). Unregister the GSI + * to avoid EBUSY errors in this case. + */ + acpi_unregister_gsi(data->index); irq = acpi_register_gsi(NULL, data->index, data->trigger, data->polarity); if (irq < 0) pr_err("error %d getting APIC IRQ %d\n", irq, data->index); From patchwork Wed Feb 23 13:31:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 1596670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=F7xNplH1; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4K3cQt2vcQz9sGY for ; Thu, 24 Feb 2022 00:32:22 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239491AbiBWNcs (ORCPT ); Wed, 23 Feb 2022 08:32:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240777AbiBWNcr (ORCPT ); Wed, 23 Feb 2022 08:32:47 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4C63BAB46A for ; Wed, 23 Feb 2022 05:32:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645623138; 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: in-reply-to:in-reply-to:references:references; bh=lcHAx0fySkmpFOX8KdQnbBbN/+DzsbfCiRJwWgig4TE=; b=F7xNplH1SsxAHtVii2jrRbKGtVArn7Qovr8EVvQM3GrcGBuksHKvu3aXHrOqULsyYKiLlR +q9X9mhqnn5g+JBlOEbwA5x752dp9u4APKhSR7YjB5CTDRUHc+M/bBEOUD2CcUrOXjn55i khpl2dUPzj7TfeGQYeCCEXtCa1pO+Zc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-258-KyRe8KxRMh2ApdtZE5hsDw-1; Wed, 23 Feb 2022 08:32:13 -0500 X-MC-Unique: KyRe8KxRMh2ApdtZE5hsDw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 04D4818049CA; Wed, 23 Feb 2022 13:32:12 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.195.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80E49832A4; Wed, 23 Feb 2022 13:32:10 +0000 (UTC) From: Hans de Goede To: Mark Gross , Andy Shevchenko , Mika Westerberg , Linus Walleij Cc: Hans de Goede , platform-driver-x86@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH 3/5] platform/x86: x86-android-tablets: Add Lenovo Yoga Tablet 2 830 / 1050 data Date: Wed, 23 Feb 2022 14:31:51 +0100 Message-Id: <20220223133153.730337-4-hdegoede@redhat.com> In-Reply-To: <20220223133153.730337-1-hdegoede@redhat.com> References: <20220223133153.730337-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-gpio@vger.kernel.org The Lenovo Yoga Tablet 2 series comes in 4 versions: 830F, 830L, 1050F and 1050L. The F postfix indicates a wifi only version and the L postfix indicates a LTE version. The 830 models are 8" and the 1050 models are 10". Despite there being 8" and 10" versions all models use the same mainboard, with an identical BIOS and thus identical DMI strings, so support for all 4 models is added through a single DMI table entry. As all devices dealt with in the x86-android-tablets modules, these are x86 ACPI tablets which ships with Android x86 as factory OS. The mainboard's DSDT contain a bunch of I2C devices which are not actually there, causing various resource conflicts. Enumeration of these is skipped through the acpi_quirk_skip_i2c_client_enumeration(). Add support for manually instantiating the I2C devices which are actually present on this tablet by adding the necessary device info to the x86-android-tablets module. This has been tested on a 830F and a 1050L tablet. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko --- drivers/platform/x86/x86-android-tablets.c | 184 +++++++++++++++++++++ 1 file changed, 184 insertions(+) diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c index 61e526e048c3..89972723f546 100644 --- a/drivers/platform/x86/x86-android-tablets.c +++ b/drivers/platform/x86/x86-android-tablets.c @@ -22,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include /* For gpio_get_desc() which is EXPORT_SYMBOL_GPL() */ @@ -182,6 +184,15 @@ static const char * const tusb1211_chg_det_psy[] = { "tusb1211-charger-detect" } static const char * const bq24190_psy[] = { "bq24190-charger" }; static const char * const bq25890_psy[] = { "bq25890-charger" }; +static const struct property_entry fg_bq24190_supply_props[] = { + PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq24190_psy), + { } +}; + +static const struct software_node fg_bq24190_supply_node = { + .properties = fg_bq24190_supply_props, +}; + static const struct property_entry fg_bq25890_supply_props[] = { PROPERTY_ENTRY_STRING_ARRAY("supplied-from", bq25890_psy), { } @@ -704,6 +715,165 @@ static const struct x86_dev_info lenovo_yogabook_x9x_info __initconst = { .i2c_client_count = ARRAY_SIZE(lenovo_yogabook_x9x_i2c_clients), }; +/* Lenovo Yoga Tablet 2 1050F/L's Android factory img has everything hardcoded */ +static const struct property_entry lenovo_yoga_tab2_830_1050_bq24190_props[] = { + PROPERTY_ENTRY_STRING_ARRAY("supplied-from", tusb1211_chg_det_psy), + PROPERTY_ENTRY_REF("monitored-battery", &generic_lipo_hv_4v35_battery_node), + PROPERTY_ENTRY_BOOL("omit-battery-class"), + PROPERTY_ENTRY_BOOL("disable-reset"), + { } +}; + +static const struct software_node lenovo_yoga_tab2_830_1050_bq24190_node = { + .properties = lenovo_yoga_tab2_830_1050_bq24190_props, +}; + +/* This gets filled by lenovo_yoga_tab2_830_1050_init() */ +static struct rmi_device_platform_data lenovo_yoga_tab2_830_1050_rmi_pdata = { }; + +static struct lp855x_platform_data lenovo_yoga_tab2_830_1050_lp8557_pdata = { + .device_control = 0x86, + .initial_brightness = 128, +}; + +static const struct x86_i2c_client_info lenovo_yoga_tab2_830_1050_i2c_clients[] __initconst = { + { + /* bq24292i battery charger */ + .board_info = { + .type = "bq24190", + .addr = 0x6b, + .dev_name = "bq24292i", + .swnode = &lenovo_yoga_tab2_830_1050_bq24190_node, + .platform_data = &bq24190_pdata, + }, + .adapter_path = "\\_SB_.I2C1", + .irq_data = { + .type = X86_ACPI_IRQ_TYPE_GPIOINT, + .chip = "INT33FC:02", + .index = 2, + .trigger = ACPI_EDGE_SENSITIVE, + .polarity = ACPI_ACTIVE_HIGH, + }, + }, { + /* BQ27541 fuel-gauge */ + .board_info = { + .type = "bq27541", + .addr = 0x55, + .dev_name = "bq27541", + .swnode = &fg_bq24190_supply_node, + }, + .adapter_path = "\\_SB_.I2C1", + }, { + /* Synaptics RMI touchscreen */ + .board_info = { + .type = "rmi4_i2c", + .addr = 0x38, + .dev_name = "rmi4_i2c", + .platform_data = &lenovo_yoga_tab2_830_1050_rmi_pdata, + }, + .adapter_path = "\\_SB_.I2C6", + .irq_data = { + .type = X86_ACPI_IRQ_TYPE_APIC, + .index = 0x45, + .trigger = ACPI_EDGE_SENSITIVE, + .polarity = ACPI_ACTIVE_HIGH, + }, + }, { + /* LP8557 Backlight controller */ + .board_info = { + .type = "lp8557", + .addr = 0x2c, + .dev_name = "lp8557", + .platform_data = &lenovo_yoga_tab2_830_1050_lp8557_pdata, + }, + .adapter_path = "\\_SB_.I2C3", + }, +}; + +static struct gpiod_lookup_table lenovo_yoga_tab2_830_1050_int3496_gpios = { + .dev_id = "intel-int3496", + .table = { + GPIO_LOOKUP("INT33FC:02", 1, "mux", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("INT33FC:02", 24, "id", GPIO_ACTIVE_HIGH), + { } + }, +}; + +static struct gpiod_lookup_table * const lenovo_yoga_tab2_830_1050_gpios[] = { + &lenovo_yoga_tab2_830_1050_int3496_gpios, + NULL +}; + +static int __init lenovo_yoga_tab2_830_1050_init(void); +static void lenovo_yoga_tab2_830_1050_exit(void); + +static struct x86_dev_info lenovo_yoga_tab2_830_1050_info __initdata = { + .i2c_client_info = lenovo_yoga_tab2_830_1050_i2c_clients, + /* i2c_client_count gets set by lenovo_yoga_tab2_830_1050_init() */ + .pdev_info = int3496_pdevs, + .pdev_count = ARRAY_SIZE(int3496_pdevs), + .gpiod_lookup_tables = lenovo_yoga_tab2_830_1050_gpios, + .bat_swnode = &generic_lipo_hv_4v35_battery_node, + .modules = bq24190_modules, + .invalid_aei_gpiochip = "INT33FC:02", + .init = lenovo_yoga_tab2_830_1050_init, +}; + +/* + * The Lenovo Yoga Tablet 2 830 and 1050 (8" vs 10") versions use the same + * mainboard, but they need some different treatment related to the display: + * 1. The 830 uses a portrait LCD panel with a landscape touchscreen, requiring + * the touchscreen driver to adjust the touch-coords to match the LCD. + * 2. Both use an TI LP8557 LED backlight controller. On the 1050 the LP8557's + * PWM input is connected to the PMIC's PWM output and everything works fine + * with the defaults programmed into the LP8557 by the BIOS. + * But on the 830 the LP8557's PWM input is connected to a PWM output coming + * from the LCD panel's controller. The Android code has a hack in the i915 + * driver to write the non-standard DSI reg 0x9f with the desired backlight + * level to set the duty-cycle of the LCD's PWM output. + * + * To avoid having to have a similar hack in the mainline kernel the LP8557 + * entry in lenovo_yoga_tab2_830_1050_i2c_clients instead just programs the + * LP8557 to directly set the level, ignoring the PWM input. This means that + * the LP8557 i2c_client should only be instantiated on the 830. + */ +static int __init lenovo_yoga_tab2_830_1050_init_display(void) +{ + struct gpio_desc *gpiod; + int ret; + + /* Use PMIC GPIO 10 bootstrap pin to differentiate 830 vs 1050 */ + ret = x86_android_tablet_get_gpiod("gpio_crystalcove", 10, &gpiod); + if (ret) + return ret; + + ret = gpiod_get_value_cansleep(gpiod); + if (ret) { + pr_info("detected Lenovo Yoga Tablet 2 1050F/L\n"); + lenovo_yoga_tab2_830_1050_info.i2c_client_count = + ARRAY_SIZE(lenovo_yoga_tab2_830_1050_i2c_clients) - 1; + } else { + pr_info("detected Lenovo Yoga Tablet 2 830F/L\n"); + lenovo_yoga_tab2_830_1050_rmi_pdata.sensor_pdata.axis_align.swap_axes = true; + lenovo_yoga_tab2_830_1050_rmi_pdata.sensor_pdata.axis_align.flip_y = true; + lenovo_yoga_tab2_830_1050_info.i2c_client_count = + ARRAY_SIZE(lenovo_yoga_tab2_830_1050_i2c_clients); + } + + return 0; +} + +static int __init lenovo_yoga_tab2_830_1050_init(void) +{ + int ret; + + ret = lenovo_yoga_tab2_830_1050_init_display(); + if (ret) + return ret; + + return 0; +} + /* Nextbook Ares 8 tablets have an Android factory img with everything hardcoded */ static const char * const nextbook_ares8_accel_mount_matrix[] = { "0", "-1", "0", @@ -948,6 +1118,20 @@ static const struct dmi_system_id x86_android_tablet_ids[] __initconst = { }, .driver_data = (void *)&lenovo_yogabook_x9x_info, }, + { + /* + * Lenovo Yoga Tablet 2 830F/L or 1050F/L (The 8" and 10" + * Lenovo Yoga Tablet 2 use the same mainboard) + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."), + DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"), + DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"), + /* Partial match on beginning of BIOS version */ + DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"), + }, + .driver_data = (void *)&lenovo_yoga_tab2_830_1050_info, + }, { /* Nextbook Ares 8 */ .matches = { From patchwork Wed Feb 23 13:31:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 1596671 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZqMYwI9/; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4K3cQt63nsz9sGZ for ; Thu, 24 Feb 2022 00:32:22 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240546AbiBWNcs (ORCPT ); Wed, 23 Feb 2022 08:32:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240571AbiBWNcq (ORCPT ); Wed, 23 Feb 2022 08:32:46 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 38F9CAB469 for ; Wed, 23 Feb 2022 05:32:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645623138; 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: in-reply-to:in-reply-to:references:references; bh=PAqqX72HBe86K7c5b94tydFPHMYguSDqrmVUhzmUyn0=; b=ZqMYwI9/bl3vAQprPyqxMvHrwpIP46vpGGQbjKd4vila0q0yUOGwpHhm4E15camNW2cIpA TjJbMS0AhJ30oeGfwyv68ZWVRg14B8y24U2gQuWnvVRhjGW76MzYFAsWJSVYSlGQt2EeD8 x9gkMvtGQbUNSwfdh4ZtwrGqoiGUbbk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-399-PPH4Ch_FOGyepQmScYgHqg-1; Wed, 23 Feb 2022 08:32:15 -0500 X-MC-Unique: PPH4Ch_FOGyepQmScYgHqg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B10FE800422; Wed, 23 Feb 2022 13:32:13 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.195.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C355832B4; Wed, 23 Feb 2022 13:32:12 +0000 (UTC) From: Hans de Goede To: Mark Gross , Andy Shevchenko , Mika Westerberg , Linus Walleij Cc: Hans de Goede , platform-driver-x86@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH 4/5] platform/x86: x86-android-tablets: Workaround Lenovo Yoga Tablet 2 830/1050 poweroff hang Date: Wed, 23 Feb 2022 14:31:52 +0100 Message-Id: <20220223133153.730337-5-hdegoede@redhat.com> In-Reply-To: <20220223133153.730337-1-hdegoede@redhat.com> References: <20220223133153.730337-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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-gpio@vger.kernel.org These tablets' DSDT does not set acpi_gbl_reduced_hardware, so acpi_power_off gets used as pm_power_off handler. This causes "poweroff" on these tablets to hang hard. Requiring pressing the powerbutton for 30 seconds *twice* followed by a normal 3 second press to recover. Avoid this by overriding the global pm_power_off handler to do an EFI poweroff instead. Signed-off-by: Hans de Goede --- drivers/platform/x86/x86-android-tablets.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c index 89972723f546..c3d2b30dbe26 100644 --- a/drivers/platform/x86/x86-android-tablets.c +++ b/drivers/platform/x86/x86-android-tablets.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -817,6 +819,7 @@ static struct x86_dev_info lenovo_yoga_tab2_830_1050_info __initdata = { .modules = bq24190_modules, .invalid_aei_gpiochip = "INT33FC:02", .init = lenovo_yoga_tab2_830_1050_init, + .exit = lenovo_yoga_tab2_830_1050_exit, }; /* @@ -863,6 +866,18 @@ static int __init lenovo_yoga_tab2_830_1050_init_display(void) return 0; } +/* + * These tablet's DSDT does not set acpi_gbl_reduced_hardware, so acpi_power_off + * gets used as pm_power_off handler. This causes "poweroff" on these tablets + * to hang hard. Requiring pressing the powerbutton for 30 seconds *twice* + * followed by a normal 3 second press to recover. Avoid this by doing an EFI + * poweroff instead. + */ +static void lenovo_yoga_tab2_830_1050_power_off(void) +{ + efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL); +} + static int __init lenovo_yoga_tab2_830_1050_init(void) { int ret; @@ -871,9 +886,15 @@ static int __init lenovo_yoga_tab2_830_1050_init(void) if (ret) return ret; + pm_power_off = lenovo_yoga_tab2_830_1050_power_off; return 0; } +static void lenovo_yoga_tab2_830_1050_exit(void) +{ + pm_power_off = NULL; /* Just turn poweroff into halt on module unload */ +} + /* Nextbook Ares 8 tablets have an Android factory img with everything hardcoded */ static const char * const nextbook_ares8_accel_mount_matrix[] = { "0", "-1", "0", From patchwork Wed Feb 23 13:31:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 1596672 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Tdz+EGHP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4K3cR82dsvz9s1l for ; Thu, 24 Feb 2022 00:32:36 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235016AbiBWNdC (ORCPT ); Wed, 23 Feb 2022 08:33:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240927AbiBWNdB (ORCPT ); Wed, 23 Feb 2022 08:33:01 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 945A1AB46E for ; Wed, 23 Feb 2022 05:32:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645623152; 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: in-reply-to:in-reply-to:references:references; bh=0hx0JlwQXca+CTPA0hZPWiVog1iyZLG1/dJmC1pA79Q=; b=Tdz+EGHPRFzcDXCuZ444Mb93xACeNUAgOtfWt1INoLf77GhX/bnQ2R0etzN+ZBmykrUL7x Gat4YtWoLuua9xGZ2OBkDFNBBZznDhrMA2CsB54/wcU0f6VySCnSwFGKH7XP4XHb2ifPHe h0e+dO4QT8E5JshkhTd7iWzsY/kk96M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-618-a0mjCXnoO7GzgAJ7NcgAoA-1; Wed, 23 Feb 2022 08:32:29 -0500 X-MC-Unique: a0mjCXnoO7GzgAJ7NcgAoA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 464F010247A7; Wed, 23 Feb 2022 13:32:28 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.195.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06708832A4; Wed, 23 Feb 2022 13:32:13 +0000 (UTC) From: Hans de Goede To: Mark Gross , Andy Shevchenko , Mika Westerberg , Linus Walleij Cc: Hans de Goede , platform-driver-x86@vger.kernel.org, linux-gpio@vger.kernel.org Subject: [PATCH 5/5] platform/x86: x86-android-tablets: Lenovo Yoga Tablet 2 830/1050 sound support Date: Wed, 23 Feb 2022 14:31:53 +0100 Message-Id: <20220223133153.730337-6-hdegoede@redhat.com> In-Reply-To: <20220223133153.730337-1-hdegoede@redhat.com> References: <20220223133153.730337-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-gpio@vger.kernel.org The ACPI tables for the codec setup on the Lenovo Yoga Tablet 2 830/1050 miss 2 things compared to their Windows (Lenovo Yoga Tablet 2 1051) counterparts: 1. There is no CLKE ACPI method to enable output of the 32KHz PMU clock on pin 6 of the SUS GPIO controller 2. The GPIOs used by the codec are not listed in the fwnode for the codec Add pinctrl code to set the SUS6 pin mux manually and a gpio-lookup table for the GPIOs to work around both issues. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko --- drivers/platform/x86/x86-android-tablets.c | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c index c3d2b30dbe26..f446be72e539 100644 --- a/drivers/platform/x86/x86-android-tablets.c +++ b/drivers/platform/x86/x86-android-tablets.c @@ -23,12 +23,15 @@ #include #include #include +#include +#include #include #include #include #include #include #include +#include #include /* For gpio_get_desc() which is EXPORT_SYMBOL_GPL() */ #include "../../gpio/gpiolib.h" @@ -801,8 +804,22 @@ static struct gpiod_lookup_table lenovo_yoga_tab2_830_1050_int3496_gpios = { }, }; +#define LENOVO_YOGA_TAB2_830_1050_CODEC_NAME "spi-10WM5102:00" + +static struct gpiod_lookup_table lenovo_yoga_tab2_830_1050_codec_gpios = { + .dev_id = LENOVO_YOGA_TAB2_830_1050_CODEC_NAME, + .table = { + GPIO_LOOKUP("gpio_crystalcove", 3, "reset", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("INT33FC:01", 23, "wlf,ldoena", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("arizona", 2, "wlf,spkvdd-ena", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("arizona", 4, "wlf,micd-pol", GPIO_ACTIVE_LOW), + { } + }, +}; + static struct gpiod_lookup_table * const lenovo_yoga_tab2_830_1050_gpios[] = { &lenovo_yoga_tab2_830_1050_int3496_gpios, + &lenovo_yoga_tab2_830_1050_codec_gpios, NULL }; @@ -866,6 +883,49 @@ static int __init lenovo_yoga_tab2_830_1050_init_display(void) return 0; } +/* SUS (INT33FC:02) pin 6 needs to be configured as pmu_clk for the audio codec */ +static const struct pinctrl_map lenovo_yoga_tab2_830_1050_codec_pinctrl_map = + PIN_MAP_MUX_GROUP(LENOVO_YOGA_TAB2_830_1050_CODEC_NAME, "codec_32khz_clk", + "INT33FC:02", "pmu_clk2_grp", "pmu_clk"); + +static struct pinctrl *lenovo_yoga_tab2_830_1050_codec_pinctrl; + +static int __init lenovo_yoga_tab2_830_1050_init_codec(void) +{ + struct device *codec_dev; + struct pinctrl *pinctrl; + int ret; + + codec_dev = bus_find_device_by_name(&spi_bus_type, NULL, + LENOVO_YOGA_TAB2_830_1050_CODEC_NAME); + if (!codec_dev) { + pr_err("error cannot find %s device\n", LENOVO_YOGA_TAB2_830_1050_CODEC_NAME); + return -ENODEV; + } + + ret = pinctrl_register_mappings(&lenovo_yoga_tab2_830_1050_codec_pinctrl_map, 1); + if (ret) + goto err_put_device; + + pinctrl = pinctrl_get_select(codec_dev, "codec_32khz_clk"); + if (IS_ERR(pinctrl)) { + ret = dev_err_probe(codec_dev, PTR_ERR(pinctrl), "selecting codec_32khz_clk\n"); + goto err_unregister_mappings; + } + + /* We're done with the codec_dev now */ + put_device(codec_dev); + + lenovo_yoga_tab2_830_1050_codec_pinctrl = pinctrl; + return 0; + +err_unregister_mappings: + pinctrl_unregister_mappings(&lenovo_yoga_tab2_830_1050_codec_pinctrl_map); +err_put_device: + put_device(codec_dev); + return ret; +} + /* * These tablet's DSDT does not set acpi_gbl_reduced_hardware, so acpi_power_off * gets used as pm_power_off handler. This causes "poweroff" on these tablets @@ -886,6 +946,10 @@ static int __init lenovo_yoga_tab2_830_1050_init(void) if (ret) return ret; + ret = lenovo_yoga_tab2_830_1050_init_codec(); + if (ret) + return ret; + pm_power_off = lenovo_yoga_tab2_830_1050_power_off; return 0; } @@ -893,6 +957,11 @@ static int __init lenovo_yoga_tab2_830_1050_init(void) static void lenovo_yoga_tab2_830_1050_exit(void) { pm_power_off = NULL; /* Just turn poweroff into halt on module unload */ + + if (lenovo_yoga_tab2_830_1050_codec_pinctrl) { + pinctrl_put(lenovo_yoga_tab2_830_1050_codec_pinctrl); + pinctrl_unregister_mappings(&lenovo_yoga_tab2_830_1050_codec_pinctrl_map); + } } /* Nextbook Ares 8 tablets have an Android factory img with everything hardcoded */