From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796293701; b=Mh6xdeBQBsbd2MUGET6juvNjl6yEKCkXD93BzbmhKUHLVRbzF0n/ewVtt+ZY1kr3hglg P/KC23z4ZX6v+lsZViFq0Eq30kPr8e+rOH6ex423MPMzjtmrGBXy6iVYKy4eHAt5l18in XF2x8ZwcJz1GDLCIQHQD2p8PKbkmbRqAjTYSa+FBByvhHCVEyXDllQO8hP+jiuqFnFHYH BNBWakWE1v7kp/bxgj7qdRWxBa9Iq8cYD7GzOSDCW1dfbmGWkG6J049tMbvm0g5iA2yiP uyu1udHRPuUL1SFXMvbebmC1oQwu48puJP206ilT2VKU70UqXodFUnUZvT0rAYcIQxw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796293701; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:Content-Transfer-Encoding:User-Agent:MIME-Version; bh=baPHAUVn105IsuTimJ1w9BpmOZR7M38wctrS7SDWUmY=; b=h2WGtv7JKVnBy4pohvy/YFGtPLCkyfCStuNiz9H58j4+63fES9wzB5fxTmdkTvwWRDfG gJePRU0/Ia7pY1fXa9SbR4sOUER1mjU/+KqbnHl6vlsnPAJGeVr1axFZLMzR9PhsEY/9U /ky8DbaSFdP7mK/xJLQdfS3PZ/6pK0bdRTEVyV7kvd/nXZren81eizo10gsRf6yaP/bLT 1I6RlpNb5bD+U0uDwrJehnhzhKlNEt9fm5CioVL+bKEQX4wcidKToXXqN6+xfZUmlNBlj 80jiKjn+SDLnpBfXgvZohdGpnHjbQcyNqQ14/2/uMu2s9TR/N1A37icL42LNiaLlVgg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=VV56OlWJ; arc=none smtp.remote-ip=209.85.221.42 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 762E3606A330 for ; Thu, 3 Dec 2026 10:28:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 762E3606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=VV56OlWJ Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-4a5024b3c28so446157f8f.0 for ; Thu, 03 Dec 2026 02:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796293700; x=1796898500; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to:content-type; bh=baPHAUVn105IsuTimJ1w9BpmOZR7M38wctrS7SDWUmY=; b=VV56OlWJpkTDetRL3dvPmM/CPQzEuV4Inh1pLSVJN7I0AvbZJPwYaFtLJd5+qtuP/o R3N0qt6IGjS6JN9JujIXyw0wcxMpLVf52wsVk357AjJMCPA2Dc6ZBGL+4bpUQ9snkIKo BYjSjRDV4xvGtTjQAmSD1qTwSXBafAWDGzjRicbiccGSIDVQemiALGau7fn3qmTNeVBz aiWw5cxE0rs55U/jM4ek6HvIzlc8EMr02YJHr94UP50EjWRslzKM6ullfjdHvjyFSoGj kMgiryB9ozG4wacNRpvnfN2eWJqz8LjbRtA4IHZthh3I+LVcKNtRdoQz0hl2xTYfFyVN TkqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796293700; x=1796898500; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=baPHAUVn105IsuTimJ1w9BpmOZR7M38wctrS7SDWUmY=; b=wrG7TVbmVI5pDvSoyFz7jsxb9qtPo1LA3gkyJDIJzEU0MpMyB4eGb4E2H+FlxYZdUW 3mo5BHZ8PRoR+aQe7ZGmCkQY/ls5vb+40w+4KCtCT98e9x4OPloZ32IE10HvrNoKD0io l/jgoc974O2OZQEi7e1rkvpcjisSVjYNg6ex6eeyZMXqlJW5T+sdsyACQr2M8OxMzRha 5DsMOjhPH1VfbnMXyrNEXjfhE4Rtnx2AvUg1TDVDlxyRlTmZmLNfOQjTRakizlyEZ1Zw 3QsoZGctfdDjKAqfR5zIgeAVW20oHVavAHdUjjBkqhe91JORjgUcYtO9vVL3i7vvm39L 7ndQ== X-Forwarded-Encrypted: i=1; AL+hErECECwm9MRYdf+MzymBoNf6KlFGLUxpUD3I1Yzh1PGySUPou7bkypFLdgbNPsXRfBwYHblq9b/bqdhDxt0=@vger.kernel.org X-Gm-Message-State: APuU4Z9oQ3EMQTBD4c4EPDIruCPCXaHEdZ7HSaMH7WeZI1OGf0ZCHxDg 7j5dwf/Pdep1QzSjHFv4RikQ2fRRrOdkR4O3CB+7jpizVCnunoMIxYn7qb0Eg9N/vJ4= X-Gm-Gg: AZFdTZftNEBR/evI3700EQjJxcM3CfdgvjAMy0gKGZqowbpBiPf8u7xlIMMsptoknvb pk84YPNVUYiuNa9SXfZnwgLWVUkZNGbkubSb8tCoOq3kPvvroSqHmGzCp43BOJInTeXSfrO5eR4 mXF9ixfWEYJklVH3zVMkaoy3JlK6QG/j7qtps0rhAutdjcAwryoe5y9rxyBmSojdh2UbvfSkGKF FQKQD/9Y0HtqzKiyVkBua9AM6FDq34uG3HPaYjFCWHE10/VTGRcXZ/ZvKauJQoueiuHU+VyRUcS 84tBfL/XjU3n3IAoRxPkbDDTXOuOR23Fz5Sg1b8XWQGkPEcf1YUN+ceVIsKrAOoyADxKfQ2zjdD 3M5r8A2UcptpQgXNX77uDvEP3Aikm68v2yYASU9AHipixbpvex2etUswv/hj0qWYf1G8lL616MN eUepmU3soqb5QHeUoVyvbjQ9q6CIRydm3nF9lKMtbb6t4Nj7CtaAKYHBpT2X/orb0lR1N4Ffnru MayweiCUtkpUPfBczaPFHrv3u4im8pX6p0gxAmlvn2gzaDtm6WZqRT+aTsZCq9tKTUdG3tTEeED 278Ig9qJXAatDu+kSdF5WYcjJR2aaORfqQ== X-Received: by 2002:a5d:64c9:0:b0:4cf:f441:d72d with SMTP id ffacd0b85a97d-4cff441d8d3mr2272349f8f.9.1796293699937; Thu, 03 Dec 2026 02:28:19 -0800 (PST) Received: from draszik.lan ([109.255.181.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4cea296f852sm5237882f8f.59.2026.12.03.02.28.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 02:28:19 -0800 (PST) Message-ID: <9b9d07921a05c8520fc53552f7c59ed6f7d8c2ac.camel@linaro.org> Subject: Re: [PATCH v2 2/7] Input: s6sy761 - split into core and I2C modules From: =?ISO-8859-1?Q?Andr=E9?= Draszik To: Lukas Timmermann , Lukas Timmermann Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andi Shyti , Peter Griffin , Tudor Ambarus , Alim Akhtar , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Dmitry Torokhov Date: Thu, 03 Dec 2026 10:28:38 +0000 In-Reply-To: <65f2dbe8-b582-4e84-bced-7fe02bb56938@timmermann.space> References: <20261128-lat3st-google-raven-touch-upstream-v2-0-1be5c1029087@timmermann.space> <20261128-lat3st-google-raven-touch-upstream-v2-2-1be5c1029087@timmermann.space> <65f2dbe8-b582-4e84-bced-7fe02bb56938@timmermann.space> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-9+build1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Hi Lukas, On Wed, 2026-12-02 at 19:15 +0100, Lukas Timmermann wrote: > At first, I tried to do this patch with regmap as I thought it would be= =20 > cleaner. But the touchscreen isn't really register based but works on=20 > single commands. As far as I understood it, regmap has features like=20 > caching, bitwise operations and handles IRQs in conjunction with=20 > registers. REGCACHE_NONE is the default, and custom framed SPI protocols already use devm_regmap_init() with custom .read/.write callbacks, e.g. drivers/input/touchscreen/goodix_berlin_spi.c paired with devm_regmap_init_i2c() in drivers/input/touchscreen/goodix_berlin_i2c.c > So on second thought I kept the transport code and just did=20 > the split. >=20 > But I have to say I'm still learning when it comes to kernel=20 > development, so any advice is always welcome. :-) Regmap is great, as you get tracing and locking and debugfs for free and it's a nice abstraction and you should be able to get rid of the manual I2C transfer code in this driver. It looks doable - you could do something like regmap + a separate cmd(dev, u8) callback (like drivers/input/touchscreen/tsc200[45].c) to allow for the 0-byte payloads (SENSE_ON|OFF) and custom SPI .read/.write for the framing (like drivers/input/touchscreen/goodix_berlin_spi.c) That would reuse devm_regmap_init_i2c() and regmap locking/tracing for all data transfers (except the 0-byte payload). Cheers, Andre'