From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f175.google.com (mail-dy1-f175.google.com [74.125.82.175]) (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 2494D30FF1E for ; Tue, 3 Feb 2026 09:49:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770112183; cv=none; b=Um5rZF1QMEC1vHRxDBX3RXw6oRblqZZj1KqrmkM+zVnCck+LimdMgJoRtblc/SDhEpaU7iGm/U2Xz8v5874pxV9rlBKUWF3+7FGDVYnWY7d3zbMuGMxf8LjvwBaMnRJ0k3s+7isMruRfarWCe5ulCmYZMhrdqIrGhhgjRh8iN0U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770112183; c=relaxed/simple; bh=8U2aCtDoyNBYX4tZKHQggHHtkY7qa/5Oyp4XlYpfO+M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JBx825yCbVOcu6RgYODzYILCybwAOngYLgXisy7JVLpVtby8PR+Y6mpEzv88QgZXmoDtDi8JxXM7QGcQdV9R2Y9ljSD3Ry7LLdNTj1Wu28cjNUY1MMmcPP5Jzr8Cw3meLS0mn6+Gr9huln7ZlQmKIABNcrqxlLgihD/uHTo98Ag= 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=jill0SN1; arc=none smtp.client-ip=74.125.82.175 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="jill0SN1" Received: by mail-dy1-f175.google.com with SMTP id 5a478bee46e88-2b751c8b6beso354696eec.0 for ; Tue, 03 Feb 2026 01:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770112181; x=1770716981; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=NFGheamZ8aEsx41A3zYIiu3pbbEmnChDtUyKtntCxg8=; b=jill0SN1eeRBRqttmfdbyB8JyqUzyvw5o/zdJMdiVB1o0GmX5q8qVTKfQ5SdLiBRs+ 80gD0NTOtc6AZcF6zhW776koo579ws5srE1ryLki4+YoecztYvHxhKKmxXUuzgdRvnRX szxUJiVAu5Sn9Ux9du+stgQgtRU3+KkNWLDYVhVd2C6LcIaWuj8ghplG/i++fWZfuaj/ K4YchJrIdNVLh5/soeiA3pwgkTOpGXTjmLHIqRrsNQXban2yLMug1vWaBVbsyiUvTsD4 l4zFron18oMZbr5PEIDNmyETxdgvlsI33d1nr5N+JEMyuyv2iYOFRuozlpsKslcVwS16 VE4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770112181; x=1770716981; h=in-reply-to:content-disposition: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; bh=NFGheamZ8aEsx41A3zYIiu3pbbEmnChDtUyKtntCxg8=; b=RqJbzUFnshyZb5jXVCNPA3NmOBLeDxKik/YVGwmahmOZWnKrIiBgglP14GafsqZ0Z4 FmGqtCv5CjfMsvpcBhnq8BznF3OL7VSk8/CbdSr5uL/r9L6/y1QwR6cPHvbtNGKLo8Lq lH+FYG2T4/SqI2isrWTMBkaE5yjqDH8Fb8ZFmGyQI8V32rydjyc+LipfpL8sQ5GhcEy4 kvNey/6cuizqOVC9QjqGziPFq2u+JT+bRpUndmltvFtUbrlMcYq4TS/APe/SC6Nqs1OG bMeSRl0W14BNlwDawzfkjfsNwuvzKKSIwcq+TySqbvmsyudsEzKrLm2xR5Q4/uok9Xma weBQ== X-Forwarded-Encrypted: i=1; AJvYcCWt4/D1P1sfT8mFbUqQCJSywtALlHX42qSjyUhxCGvsSdtaNiwZVQPc7bD0DtxDj8qVv3Pbo35+dBXSm88=@vger.kernel.org X-Gm-Message-State: AOJu0YwIpZ4HbuZuZEzwNklYmTLO/Xzs6pxXNs8QKGpJ6JO1lIfB3ZPA A3Ll21KC5aZR0eYqpl22bThzqA7pa9SHL5IhVfyDjq/j/+RcFNVH2qwS X-Gm-Gg: AZuq6aLSTGbXqzI/xnxexnaWxYujeGYQRIp65FdtSLx5KEIv8rAFuXdfsItN2gLPAh4 pOQf9ytJOcgkU7Tfdi2VlDI3A3BUb/zKrxd6Z7pK9Bl/s8MaSYyH7nqChxgFGUJMZ2LdWNq6FvX OOB4VPgOaZJZelzr2wQtxQjT6gedV2HQJn+9u3ulVW8E6rxgjtmGdWifNRd8HN5l1GVctu4n1Gb pJkYV98fLnbYqZ4K64/brOoqbnyeYX1hz/Q/Mz1PZr9hPF5kJP6y59IWWI57XLjxVV+iZIXqDD5 kJ2npT7YJMsrMSlmPPlJDYd3waL12z6t8nSbXTKVNYC3DKhIfbC4RMQulDKN+zqBtzRkYrirS/Y fP0gjnKMNXX/BTp4jo9NY8nqdRdw8ZHo0SjCXhmt9F4ByclfnAy/xtKF1HttF2e6L2fB5dFZgcl ksuHBPUuhWzBWXr61jJZjkj8vR5c97xmHTb9P3jRrwLlRwE5ul X-Received: by 2002:a05:7300:214e:b0:2b7:20fe:821d with SMTP id 5a478bee46e88-2b820eae81cmr742075eec.10.1770112181077; Tue, 03 Feb 2026 01:49:41 -0800 (PST) Received: from google.com ([2a00:79e0:2ebe:8:ea13:571:b19b:36]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b7a16d01c4sm21943170eec.2.2026.02.03.01.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Feb 2026 01:49:40 -0800 (PST) Date: Tue, 3 Feb 2026 01:49:37 -0800 From: Dmitry Torokhov To: Konrad Dybcio Cc: Luca Weiss , Griffin Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v2 2/3] Input: aw86938 - add driver for Awinic AW86938 Message-ID: References: <20260128-aw86938-driver-v2-0-b51ee086aaf5@fairphone.com> <20260128-aw86938-driver-v2-2-b51ee086aaf5@fairphone.com> <472d7db3-db34-4966-aa17-588e1153ba12@oss.qualcomm.com> <34fa533c-b9ab-4025-b9ad-4041837e790c@oss.qualcomm.com> <6fa17bda-4d4a-4b31-99a2-1d2b606b663b@oss.qualcomm.com> 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: <6fa17bda-4d4a-4b31-99a2-1d2b606b663b@oss.qualcomm.com> On Mon, Feb 02, 2026 at 04:11:51PM +0100, Konrad Dybcio wrote: > On 2/2/26 12:04 PM, Dmitry Torokhov wrote: > > On Mon, Feb 02, 2026 at 11:19:36AM +0100, Konrad Dybcio wrote: > >> On 2/2/26 11:14 AM, Luca Weiss wrote: > >>> Hi Konrad, > >>> > >>> On Mon Feb 2, 2026 at 11:12 AM CET, Konrad Dybcio wrote: > >>>> On 2/1/26 2:49 AM, Dmitry Torokhov wrote: > >>>>> Hi Griffin, > >>>>> > >>>>> On Wed, Jan 28, 2026 at 04:51:14PM +0100, Griffin Kroah-Hartman wrote: > >>>>>> @@ -717,9 +746,19 @@ static int aw86927_detect(struct aw86927_data *haptics) > >>>>>> > >>>>>> chip_id = be16_to_cpu(read_buf); > >>>>>> > >>>>>> - if (chip_id != AW86927_CHIPID) { > >>>>>> - dev_err(haptics->dev, "Unexpected CHIPID value 0x%x\n", chip_id); > >>>>>> - return -ENODEV; > >>>>>> + switch (haptics->model) { > >>>>>> + case AW86927: > >>>>>> + if (chip_id != AW86927_CHIPID) { > >>>>>> + dev_err(haptics->dev, "Unexpected CHIPID value 0x%x\n", chip_id); > >>>>>> + return -ENODEV; > >>>>>> + } > >>>>> > >>>>> If we are able to query chip ID why do we need to have separate > >>>>> compatibles? I would define chip data structure with differences between > >>>>> variants and assign and use it instead of having separate compatible. > >>>> > >>>> dt-bindings guidelines explicitly call for this, a chipid comparison > >>>> then works as a safety net > >>> > >>> Are you saying, that > >>> > >>> 1. we should enforce dt-bindings == CHIP_ID (what's currently done) > >> > >> This > > > > No. If there is a compatible chip with different ID (for whatever reason > > - maybe there is additional functionality that either board does not > > need or the driver does not implement) we absolutely should not refuse > > to bind the driver. > > > > Hint: this thing is called _compatible_ for a reason. > > Right, the reason you have in mind is fulfilled by fallback compatibles > > (i.e. "vendor,actualchipname", "vendor,similarchipname" where the driver > only considers the latter becuase the software interface hasn't changed) And having chip_id checks will break this... > > > > >> > >>> > >>> or > >>> > >>> 2. we should have both compatibles with no handling based on compatible, > >>> but only use CHIP_ID at runtime to change behavior > >> > >> This is spaghetti > > > > I really do not understand the aversion of DT maintainers to generic > > compatibles. We see this in I2C HID where we keep adding compatibles > > for what could be described via device properties. > > This is because it's the only way to allow for retroactive changes that > do not require changing firmware. That's why ACPI carries new identifiers > for even very slightly different devices too. Once the firmware containing > (ACPI tables / DTB) is put on a production device, it is generally not > going to ever change. They are actually solving slightly different problem. In ACPI world they allocate a new ID to represent a peripheral in a given design, down to it's firmware behavior. It encodes much more than chip ID that DT maintainers want to key off of. > > CHIP_ID registers are a good tool to validate that the author of the > firmware table is doing the right thing, but solely relying on them > encourages creating a "vendor,haptic" compatible, which I'm sure you'll > agree is totally meaningless. Is it? If a piece of hardware speaks i2c-hid protocol why do I need to know the exact chip that is being used? Depending on the chassis and the size of the sensing element and the version of the firmware that is loaded into it the behavior and timings of the same chip may be very different. > > That's especially if the naming scheme makes no sense and you can't > even factor out a common wildcard-name (which also happens to be the case > quite often) > > Plus a compatible is used to restrict/modify the set of allowed/required > properties, so having an "actual" compatible is required for schema > validation to work Yes, in cases where there is not a common set of properties having different compatibles makes sense. But in cases when the device is supposed to have vendor-agnostic behavior insisting on myriad compatibles makes little sense. Thanks. -- Dmitry