From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF75935F170 for ; Fri, 24 Jul 2026 19:25:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784921151; cv=none; b=Yg3D8uxpu88vz9oeEOayzg9vf07rLoYV1idU2xjksk6GObqWaxMb0mr3MWS7OuSNRqfjQZvQs+7rfdzU9LwzRvoTnkzSTq+a0MrlFLoXVzNXrdMfpsAXDRoaPgNKO4F/xmX5dkyq699CFsVvJsj1JUPV5hEYTaeAqeSOiD6c+5Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784921151; c=relaxed/simple; bh=2ksqF5z1sIMNtrP1tAqgcwchwd8cY45U2teQX6Ds30I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BArfcskloTk/uvUwtz2IePewHE4x2qwjBQ/lrK7BpI+shSabugydW5kAlGuMP+hfW6YMKNaAyDaANru9zZJdjglVmBBFjvZwNgfLvzAgnTAUJ0GJOJ/i4ln9AnBlP4d6Lq7SL/NIkP15fgC075+Z/gaqt0iGymEM3ocbB8S8VTo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U5DpW+Qj; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U5DpW+Qj" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2ceae1ed204so9350375ad.0 for ; Fri, 24 Jul 2026 12:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784921149; x=1785525949; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=c0tC7vV+OGBtLj6C1dSzqQ74owp2ZWgS4CBF+5vZQqs=; b=U5DpW+QjLEhqPtA+4gUme0zWGhUPsgeSIqst2Jeo+WStjwobZ4fKCeqjNNhq2XTuZs jE3VHDwxCvUV5/MadJGYXMJxD1SnPUf/29Q87RU/Q6A4d/b95GjVc/SyKpZQ1+D0g8iY zniCZVpX51oPFw7WKgTLGGUO1lxc+SRK2z2nISMo1doTxNnZUms5Ksa/TRqNYQf2ZclK U3trorjmjVZkP/nrlmq0KymALkVquD81llgC4dPj9VYgxEtnmX4zDCS5l4HrIgYAAZjM 6m5MeAUXpskUg3DCncGrJpTDk6ZzM6+9wHY0vI0z+T6YLuf9a1MbH3iYFiBDe0bHyfgc 4bFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784921149; x=1785525949; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=c0tC7vV+OGBtLj6C1dSzqQ74owp2ZWgS4CBF+5vZQqs=; b=C38+pDitmivEtmbimzorftvggNC7Mm4V2ZNjqn0cG311jnLbtYqbaqPgue9k2Jk3qW d/bLL8EgDLhOeQhqRFabyi+tGeVoOgMKrDNWj0m5HjTGb1WM6v0JaoeFCJP8T+E/9ZS6 FcO6lBIgrEkmhwE38d2pZPP9naFnG9V5K1AL1H/ANQQmlyD44JfCMwA72e8DHnFxD5NO poLpOKqiPJT2HKe4OZpYUSKGHpdKQo9pqhrmIBO1XH3hCWpQuQifGQWH078YeuIu/oRb LGqWgK2fb6mFFaSFJ7LsFZ1sFive1w/VYlC7II0yPozwQGjs5wrZN1Wwhtn6+IYm2eT/ UZpQ== X-Forwarded-Encrypted: i=1; AHgh+RoD79Bjtp8c8rfHARo5IyQ4n3G3GdTm/lmF3zgWTqV/5JPf0acq6UHCN0RzNnObX79rtoztL9ku9+Jo/LM=@vger.kernel.org X-Gm-Message-State: AOJu0YzRViO7WvADDEIJSPW7hnGaZF9ubvlvX42nHXc0Qd1X3G3JljnM Eh36Nko2Ql3MyrcOjoTR3gVrJL3sm/z2V/7nWqghrdVKch/nSesUj7wC X-Gm-Gg: AR+sD13RwNLfamw19jL4J2FbFc9iuuGV+3NU7hcDNx+Vxl4ddtg8mlIb+nKm0DDg7kY OiVUBm1BRo8exaR9wu/tTxQSrHuquiQ8bW1ph1wafvDxqhwXp3luTVCoT14dNc8EmXkCPZgITsv GkMPn1CYEysw7bSmx2hX4OgnrqNe/Hu6lvu8lidoNyxWOys3u1K+sAqfNhUixVyquAa6jx3LvtI tVvUI6VqZ06YXwlDGu8aa3lOlr4RKRkaBgPCb2tYHYDZ3MmSxp3oa7Ai95cv78fRE+1nZhOSkLH bp93EHvzZZOUaOu+4t/HpH/uF22MejTV9eKGdkRc1p1Pe2TtPNbowmICaQ8ARg05giIPBFP4ArK Uy8i+SWAi0XZxZNyoxOlzye7AIP73rm+aPQT/vSdSJDrvHuYTD++F9Jt6n/aNUklN4Mbi0ssYhC i2ELfUjSz5RAYpTp9L0hv4mMCJwxAdDV8AXt42pR6C/+8= X-Received: by 2002:a17:902:d491:b0:2c2:62ee:5a0d with SMTP id d9443c01a7336-2cfa6b77547mr101121265ad.14.1784921148827; Fri, 24 Jul 2026 12:25:48 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:40e1:40e4:dabe:543e]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-314bc579127sm1679206eec.21.2026.07.24.12.25.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2026 12:25:48 -0700 (PDT) Date: Fri, 24 Jul 2026 12:25:45 -0700 From: Dmitry Torokhov To: Kaustabh Chakraborty Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Srba , Linus Walleij , Peter Griffin , Alim Akhtar , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: Re: [PATCH 3/5] Input: zinitix - add support for modes 0 and 1 Message-ID: References: <20260724-zinitix-modes-v1-0-f6df7d86a878@disroot.org> <20260724-zinitix-modes-v1-3-f6df7d86a878@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260724-zinitix-modes-v1-3-f6df7d86a878@disroot.org> Hi Kaustabh, On Fri, Jul 24, 2026 at 12:54:05AM +0530, Kaustabh Chakraborty wrote: > Zinitix touchscreens have three modes, numbered 0 to 2. The driver > implements mode 2, and leaves out modes 0 and 1. The difference in the > touchscreen modes is the schema of the event data. > > Implement modes 0 and 1 in the driver, along with their event structs. > Maintain a common, canonical event struct which is to be the superset of > the mode-specific structs. With that, introduce functions to convert the > mode event info to the canonical format. > > Signed-off-by: Kaustabh Chakraborty > --- ... > +static int zinitix_read_point_status(struct bt541_ts_data *bt541, > + struct touch_event *event) > +{ > + switch (bt541->zinitix_mode) { > + case 0: > + return zinitix_read_point_status_mode0(bt541, event); > + case 1: > + return zinitix_read_point_status_mode1(bt541, event); > + case 2: > + return zinitix_read_point_status_mode2(bt541, event); > + default: > + dev_err(&bt541->client->dev, "Mode %d is unsupported\n", > + bt541->zinitix_mode); > + return -EINVAL; Instead of a switch this can be a pointer to "read status" function. Thanks. -- Dmitry