Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp834820pxu; Mon, 23 Nov 2020 05:29:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCE6KfUlZSYYqWdHOtzIvO8f2AWPgCvlQz5CBD8XOQcPS54HR4WfV0dFyHgTMq3BgwB1rm X-Received: by 2002:a17:906:a3d2:: with SMTP id ca18mr5560897ejb.107.1606138192668; Mon, 23 Nov 2020 05:29:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606138192; cv=none; d=google.com; s=arc-20160816; b=eBXxLI4cC9IhsC4E6kN3GTIdLfptmph9FjhcFks7cjtqQdQOIj9afwKzikDLIHu2+y aQgzB85EhSJhheMNLhRtkjIVGIRPT70mDuQyQud7LVspPXGykaFRl3lT3tvzNeWf22RT 42qvwi97/+jzowUksfNlbZI29NNbytkHmcjfOBKUniZ4JfeV2VX+KIE0qORQR/h1DsZ6 gR+6Ffm6ueUX0AEd4sTIKLOtOVNtb7lu1AXGmaMiSVWft3BLDPHx5H90W7Qmi2lxRKgo CQGkcbLZiRQzxCcPDA2oQSK87NCIkCGJo2nmyarATefUi0RLPkUqgfQRjkzHvHrmD/tV 0nQg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=ewgMRr9UHsgd2BkdxxK3tXSdQ0dcj2RTMLUTKrdHbyU=; b=Xrd1jFMQ85WC/fECj08JYmMccoH8NjU6QFaNCFhlbIW0T2WXnKsA2ayPl7KDS2mlfR Cld/gMJPotQtPYhO4jsotxxxKNo093Fw3GkfQlI434gU5c74Vp4jk4Ym9WeTd+BXhkG3 qbg+p9IraadNdf+3SH/r2NTUNLVHUr9PRJsbFRTifSkLXL3mMitHlg2VjrYqyPMlCftM iRXOY5g/yhi3pwyT6vc2tnNMSSg774OL0rAhyF3bdbOIRQyXV6vNt2xPWyL2v5TfL7ED NdVXYWZMH4goWDyTWBgsdh4//CNIVHzYmRJmGBTABiaX0u9lyG8lFe4vcn5ld6HYmah7 vuKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eYXTYNlQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si6446481ejc.458.2020.11.23.05.29.29; Mon, 23 Nov 2020 05:29:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eYXTYNlQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389072AbgKWNYg (ORCPT + 99 others); Mon, 23 Nov 2020 08:24:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:45340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731277AbgKWMdz (ORCPT ); Mon, 23 Nov 2020 07:33:55 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D116520888; Mon, 23 Nov 2020 12:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134833; bh=WBAvjVB0ZU3IAXX2vBAN67JB9f8nQYR74PsalvQo9PU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eYXTYNlQfXE0o6FZ6dRYYoZpQ+ZcZn595q42aBLk6XJ1Yzb7fLRXbIFO+uuTtwkoX xp9Jf0uhnsfh93sNWbzm50TSky826IMRbXeAt6kaMVOTaOO7nRO9YAI200NFRia0K9 bx7YyNroGG9FWVPVhyUOb6gumOdh3fhCNhk2Zfrc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 4.19 76/91] iio: accel: kxcjk1013: Replace is_smo8500_device with an acpi_type enum Date: Mon, 23 Nov 2020 13:22:36 +0100 Message-Id: <20201123121813.018064320@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121809.285416732@linuxfoundation.org> References: <20201123121809.285416732@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede commit 11e94f28c3de35d5ad1ac6a242a5b30f4378991a upstream. Replace the boolean is_smo8500_device variable with an acpi_type enum. For now this can be either ACPI_GENERIC or ACPI_SMO8500, this is a preparation patch for adding special handling for the KIOX010A ACPI HID, which will add a ACPI_KIOX010A acpi_type to the introduced enum. For stable as needed as precursor for next patch. Signed-off-by: Hans de Goede Fixes: 7f6232e69539 ("iio: accel: kxcjk1013: Add KIOX010A ACPI Hardware-ID") Cc: Link: https://lore.kernel.org/r/20201110133835.129080-2-hdegoede@redhat.com Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/accel/kxcjk-1013.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -134,6 +134,11 @@ enum kx_chipset { KX_MAX_CHIPS /* this must be last */ }; +enum kx_acpi_type { + ACPI_GENERIC, + ACPI_SMO8500, +}; + struct kxcjk1013_data { struct i2c_client *client; struct iio_trigger *dready_trig; @@ -150,7 +155,7 @@ struct kxcjk1013_data { bool motion_trigger_on; int64_t timestamp; enum kx_chipset chipset; - bool is_smo8500_device; + enum kx_acpi_type acpi_type; }; enum kxcjk1013_axis { @@ -1241,7 +1246,7 @@ static irqreturn_t kxcjk1013_data_rdy_tr static const char *kxcjk1013_match_acpi_device(struct device *dev, enum kx_chipset *chipset, - bool *is_smo8500_device) + enum kx_acpi_type *acpi_type) { const struct acpi_device_id *id; @@ -1250,7 +1255,7 @@ static const char *kxcjk1013_match_acpi_ return NULL; if (strcmp(id->id, "SMO8500") == 0) - *is_smo8500_device = true; + *acpi_type = ACPI_SMO8500; *chipset = (enum kx_chipset)id->driver_data; @@ -1286,7 +1291,7 @@ static int kxcjk1013_probe(struct i2c_cl } else if (ACPI_HANDLE(&client->dev)) { name = kxcjk1013_match_acpi_device(&client->dev, &data->chipset, - &data->is_smo8500_device); + &data->acpi_type); } else return -ENODEV; @@ -1304,7 +1309,7 @@ static int kxcjk1013_probe(struct i2c_cl indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = &kxcjk1013_info; - if (client->irq > 0 && !data->is_smo8500_device) { + if (client->irq > 0 && data->acpi_type != ACPI_SMO8500) { ret = devm_request_threaded_irq(&client->dev, client->irq, kxcjk1013_data_rdy_trig_poll, kxcjk1013_event_handler,