Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1252293pxu; Mon, 23 Nov 2020 16:03:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+6zNRdnxDZpiKnk4DwFXFi5xnnzcUM7zFf3g5Q+1gUeCYxH43gaNabysL1SdVC6TY1pg0 X-Received: by 2002:a05:6402:370:: with SMTP id s16mr1559537edw.50.1606176204059; Mon, 23 Nov 2020 16:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606176204; cv=none; d=google.com; s=arc-20160816; b=BmXHHBJ319C9NCmSciVlbM30kBKpIXg2YFrZOFKhVCvw9NI5REzjwv+zT/5XPiEL0j SsP0ghESbGBbseIip57TygrosLGIml7/MeFxp/hXA+eMs4BDqkTCVmvvQWYlW0GWZRNM s87sFmrji6gnzV4ITkobPfbQliwDIXZCV4kr+VJids7Cj/valSbzxIXGLT7QjNaxOnmn dyYkQbTsnOfoi6AxW/MGf7mpAppWYWXUEF6HcF5sma3IhULLqgFVzULLad8EIX0NmsFH 090JEuGAeg/SDGXgOAOA60+ZYbAlqV8VyFWIxRSjsA59Gjof5KXSLYAOF4V7QSwep7xL rYWQ== 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=CmbrKOnlA36lQqLYUZu+YxIL0tcDgc1Y9v/7u5Epbzo=; b=TvK32y0OfSBNjTaTmPRLlk+mm17wwnGvVC6dB8ZpdgYOAq1zy7mfDRz7SKkFlQbdhb Cjp9PrbEK1W4fKaZYMdW6xg/R0GkpHzURPvLYx/xvJpRxep1NF63oXDTGDqpJI1+4jVT YpnYSrtKLpOxGviO+Mdil/uOYKiQQ+kze0oISMSkIGt/xtLhwHO/6rfNymi/sE7yMufZ zLMtEHYhR37OQQvFlINlVSFTZOEd1ZcD5t5gY4uiQmyy4wFLSZxAWrWk1RQJlAdsLSA2 /A1guiFCn46cRqBZiLy/OxT6Vyc1Dtbl6vj8YmUJbACw6dz3R+2L9k4b5Xxpeir0Z3UZ mLbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="BqCgQt/S"; 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 p9si7603239edm.38.2020.11.23.16.03.01; Mon, 23 Nov 2020 16:03:24 -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="BqCgQt/S"; 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 S1732351AbgKWNT5 (ORCPT + 99 others); Mon, 23 Nov 2020 08:19:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:52178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732273AbgKWMjb (ORCPT ); Mon, 23 Nov 2020 07:39:31 -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 55B0120888; Mon, 23 Nov 2020 12:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135170; bh=LVl9AgLF4EMvwg7O7NqXDbzsSL8wwpORgfCwtTvJvKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BqCgQt/SOZz517WpROkZocbLY4NPUaIF9708BhY/Z7wsVTzmePANOXQE2dNdw8aQM 4Ofm0xkFCXWZaLTEPvZmisxjsVsmlAzK6jTlqmrr/5YWt9m98mBql3leUkmZbXl6/q BmufDJXXZFy5bQZAGVnb1SNXzvwcWMksMwf/HY5o= 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 5.4 130/158] iio: accel: kxcjk1013: Replace is_smo8500_device with an acpi_type enum Date: Mon, 23 Nov 2020 13:22:38 +0100 Message-Id: <20201123121826.198910030@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@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 @@ -126,6 +126,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; @@ -142,7 +147,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 { @@ -1233,7 +1238,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; @@ -1242,7 +1247,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; @@ -1278,7 +1283,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; @@ -1296,7 +1301,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,