Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp186705lqh; Fri, 3 May 2024 19:08:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2ttI0bOVQqC93sdmJXbQVPlR2sxFtxZq0C6glK4HkAG7Ze/KBrnugnU5UWhKJoZwerKeGZMtou0qVi1gJZmOXM2+lz860563hp4QiCw== X-Google-Smtp-Source: AGHT+IFEs3LDMbzUSlkIViIVHfnaFappStnr8yZ+HK4RH3xwaG+J/tC/5RyzBAwLPPI5Ew+7hlMB X-Received: by 2002:a05:622a:4d1:b0:43a:5f3b:e3d0 with SMTP id q17-20020a05622a04d100b0043a5f3be3d0mr4665734qtx.9.1714788499127; Fri, 03 May 2024 19:08:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714788499; cv=pass; d=google.com; s=arc-20160816; b=wUb3JfjtT+MH2BiXJ4edc0Lh/DpjQRzAejmvPP9VzRTT+GITijtFkx4khEZMVEtQ0M iLda84/HlCCqJlPpeWvmclAMMDGOAMXVMty0SjF1W9sWN6Db9SP2+IbdwZVfvvY6RNlX 21JiUS4MRJm5e6+QzQ2sAgJfNu1x8r9P7D0GP/LCUc9iNRrNCDIpth6cCxPzv2CdVnJx Qi0nVBGDqW4vBdvJLFo92lEOr0MxuDjdng+1Ai4J49x1LoN1Ccei75v+g1kaV/1efT5c o2cZeE9fF2WvPIvLg5U3Q4RVJ5VoG1KEluEkSIZTqsBXsU6GGFj9Tv0xnB26zwr6KuPg GgSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Js+Zw4ZWqNvFMC47UtCh2KmzrfI0HQ6+4EhdmIXK07Q=; fh=76cJalXk/Nc7CFFIV3YP/4kdYDDk3TuA9hz/thZjiC4=; b=bpbkYx93wCPCLL4h79iKgDnpGwxR78gslY66K7vIgfmUu/C/3LQSMDKbPK1aagXvXi x5UmTL/hskVtebXdO++7cNiinfAZHEkIaKHs1TDm5cBN+VrYv+E1PAps/ZBNGATxZFxF SjL6Z1sFSXyqibMDsgL7/jFn1Cp911a1DyGgpteAIkjYHoQoF3GlB84s6LzB5B0dXDqE Yry6b/G+rYj0AAvX6G8f317EsrNdBkXEg9crfq5aleVhsMohuvE8+luTJndMvCvu6euo spk3qs1eFOyWgp16dxsHAeYvKFuqXdIyfepgtVy4osJa7R/fqXTXWEBfnDs/6s2qRviJ E6Iw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kaechele.ca header.s=201907 header.b=phcGVvHB; arc=pass (i=1 spf=pass spfdomain=kaechele.ca dkim=pass dkdomain=kaechele.ca dmarc=pass fromdomain=kaechele.ca); spf=pass (google.com: domain of linux-kernel+bounces-168491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168491-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kaechele.ca Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u35-20020a05622a19a300b00434733fedafsi4827636qtc.456.2024.05.03.19.08.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 19:08:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kaechele.ca header.s=201907 header.b=phcGVvHB; arc=pass (i=1 spf=pass spfdomain=kaechele.ca dkim=pass dkdomain=kaechele.ca dmarc=pass fromdomain=kaechele.ca); spf=pass (google.com: domain of linux-kernel+bounces-168491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168491-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kaechele.ca Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D7A711C22F74 for ; Sat, 4 May 2024 02:08:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1ADF1107B3; Sat, 4 May 2024 02:08:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kaechele.ca header.i=@kaechele.ca header.b="phcGVvHB" Received: from mail.kaechele.ca (mail.kaechele.ca [54.39.219.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3183539C; Sat, 4 May 2024 02:08:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.39.219.105 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714788485; cv=none; b=jugULHSrd2tGjRuKFiZ/GAfXrhipIJoDcDpDrJIEXoVrRil/gqh6D3tt9gUqpUMzxQKJPu79InCIZ2iFaz+PpZ6l3V8fg2WCM+ucQSVTKqntQ5we7wzaWygtjuFk70Bx+eSEvMPOaAW9lOQ2qgeKwhK4lwsce0KD9D3LwvKpL7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714788485; c=relaxed/simple; bh=Pe7QETLG9b6pCpN9wEnqqft2nXgNoO+6kB1TkY+IC+g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NSu6umkp4ABZOr2hYtTPXKJP24FYH7rR6MoDgA5FpVb14nBUrqBsMPMai1ohESCfqf7ZNH3FU6Sqy7aJDj1Rurngds02VIdLUJlVdGOM1ba7Fh4VCJljKxJzZZ2K9QUSVU92FkypQ4SFE+gfu6z6ufSS0QpejijpKFCRqL0+HnI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=kaechele.ca; spf=pass smtp.mailfrom=kaechele.ca; dkim=pass (1024-bit key) header.d=kaechele.ca header.i=@kaechele.ca header.b=phcGVvHB; arc=none smtp.client-ip=54.39.219.105 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=kaechele.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kaechele.ca Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 692DDC0076; Fri, 3 May 2024 22:08:14 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kaechele.ca; s=201907; t=1714788495; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=Js+Zw4ZWqNvFMC47UtCh2KmzrfI0HQ6+4EhdmIXK07Q=; b=phcGVvHB/akJpzBsxB0+PWlrLVr9iYWsvD+PQ44gOmxos0bcl7+3hBGhQwcSG/5z/j8iZK pV0LGHODZZhNR8kDQy5CTyQ4sJ508B7AN1bAb7eiF7qtcBH9V0cZU55jogFzgLbo77sRRW ftc/DfMawSkSFfh+t/eeAkmirR9rBkc= From: Felix Kaechele To: Job Noorman , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paul Gale Subject: [PATCH 6/6] input: himax_hx83112b: add support for HX83100A Date: Fri, 3 May 2024 22:04:45 -0400 Message-ID: <20240504020745.68525-7-felix@kaechele.ca> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240504020745.68525-1-felix@kaechele.ca> References: <20240504020745.68525-1-felix@kaechele.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 The HX83100A is a bit of an outlier in the Himax HX831xxx series of touch controllers as it requires reading touch events through the AHB interface of the MCU rather than providing a dedicated FIFO address like the other chips do. This patch implements the specific read function and introduces the HX83100A chip with an appropriate i2c ID and DT compatible string. The HX83100A doesn't have a straightforward way to do chip identification, which is why it is not implemented in this patch. Tested on: Lenovo ThinkSmart View (CD-18781Y) / Innolux P080DDD-AB2 LCM Signed-off-by: Felix Kaechele Tested-by: Paul Gale --- drivers/input/touchscreen/himax_hx83112b.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/input/touchscreen/himax_hx83112b.c b/drivers/input/touchscreen/himax_hx83112b.c index 667611c5a018..984baef495e1 100644 --- a/drivers/input/touchscreen/himax_hx83112b.c +++ b/drivers/input/touchscreen/himax_hx83112b.c @@ -4,6 +4,9 @@ * * Copyright (C) 2022 Job Noorman * + * HX83100A support + * Copyright (C) 2024 Felix Kaechele + * * This code is based on "Himax Android Driver Sample Code for QCT platform": * * Copyright (C) 2017 Himax Corporation. @@ -37,6 +40,8 @@ #define HIMAX_REG_ADDR_ICID 0x900000d0 +#define HX83100A_REG_FW_EVENT_STACK 0x90060000 + #define HIMAX_INVALID_COORD 0xffff struct himax_event_point { @@ -291,6 +296,13 @@ static bool himax_verify_checksum(struct himax_ts_data *ts, return true; } +static int hx83100a_read_events(struct himax_ts_data *ts, + struct himax_event *event, + size_t length) +{ + return himax_bus_read(ts, HX83100A_REG_FW_EVENT_STACK, event, length); +}; + static int himax_read_events(struct himax_ts_data *ts, struct himax_event *event, size_t length) @@ -436,6 +448,10 @@ static int himax_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(himax_pm_ops, himax_suspend, himax_resume); +static const struct himax_chip hx83100a_chip = { + .read_events = hx83100a_read_events, +}; + static const struct himax_chip hx83112b_chip = { .id = 0x83112b, .check_id = himax_check_product_id, @@ -443,6 +459,7 @@ static const struct himax_chip hx83112b_chip = { }; static const struct i2c_device_id himax_ts_id[] = { + { "hx83100a", (kernel_ulong_t) &hx83100a_chip }, { "hx83112b", (kernel_ulong_t) &hx83112b_chip }, { /* sentinel */ } }; @@ -450,6 +467,7 @@ MODULE_DEVICE_TABLE(i2c, himax_ts_id); #ifdef CONFIG_OF static const struct of_device_id himax_of_match[] = { + { .compatible = "himax,hx83100a", .data = &hx83100a_chip }, { .compatible = "himax,hx83112b", .data = &hx83112b_chip }, { /* sentinel */ } }; -- 2.44.0