From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 4A43D378D8B for ; Mon, 2 Feb 2026 15:11:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770045117; cv=none; b=Fl8P4YLP2ErYFpjASU/dF9aHCSPaR6IraZNnFet0xOC3U2VQPsuWZTQo4xA2gadFWeVPY0dnuFlghFXRQKYHtZ3pGM3XsQViiPjBvqbtq0qrKrHWlp8v7pOKdfUKb+ThzzciG/oR4s5w4qz3Wp6jyzAEg/EZ7UGt2/NVj8zZNkk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770045117; c=relaxed/simple; bh=OZr9ZTlaroAleY7MwtWXX1cJKnosxtGblpAeyNoK+AU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QdqbP2lMO/AUS3s6JW20IBsM2eKuONkINuDuxHurdbHlX5pPr2Un7cdWP1IZE7BT+a4EQD4d43HNIZ+6B8uS2jr6mo5mJomuUFgGjLhOyvq3hEezj9nyfF+FqB9n5o9RRP5gbT3Vv0D9e9GRwlkAAEjF9FbASqgGOqvoI6ZsZB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=oEXYM0LY; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ih878Wki; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="oEXYM0LY"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ih878Wki" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 612AtIgp3915994 for ; Mon, 2 Feb 2026 15:11:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= pmf+AHruoKI1g45Fl88mwp2EJ/7UQ9ULt/yYUiyYEc8=; b=oEXYM0LYygJ9y248 t5Cc5u7L27obzG64rqeUh/MxtPYtmjBB7VD/EB/s7jw8+HgwnEpbELV79RNf49mg tGgqUjsZ9QQZgfcFVrxedjZSWxlvrQF/ho8q2aYrUlp75980a1oam8c3u76yOqLX dG23x0GSzShejp++jpzuT7gyomsDpwc2rEjh8RpusUxPx59bpQiT2aDzB1VuZjpV XzVpl10+CyMr2hfX4wMCSWDRTalT8BK6lXYhlBA4mDX57Y//gHszHE7Iop00+pOY ptkkYAdAv+qDnNXWsbEwtMuYetZt+36B6rNvvE5fKhmEdpJMwjzjpXGhMFJb/rA4 DxENMw== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c2tkmgpvs-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 02 Feb 2026 15:11:55 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8c70c91c8b0so121727385a.2 for ; Mon, 02 Feb 2026 07:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770045115; x=1770649915; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pmf+AHruoKI1g45Fl88mwp2EJ/7UQ9ULt/yYUiyYEc8=; b=ih878WkiGI51T/FfqU+xHj64CrtMVzSspVXFoZ8Azf3nm43MR18+Dfpr6zHSX6nUA0 1gE/Hq2DsYti7uZ6SgLykWTuC2AFXdF9G1dil0ISYn7dkfSTo/J9xn7wGoz8EAePU8JN hiV1geMVrJuLFEz+exwcKTbUH+F7Op9WsKo4lG/M2TkKfnaE10n9oVFovocXkQ897147 FoIlFYLnP6jg459ZqBOSKrBNDygw4MY45U4CLxBCZxulakStEPwg5ql24+PmKUyTdKjt W3oqcD43woF83S/jSHvuZLXTAek22VA5H+2IJHm4+CFuFfq91IlTMYwQBWgBdvQk09c6 oasw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770045115; x=1770649915; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pmf+AHruoKI1g45Fl88mwp2EJ/7UQ9ULt/yYUiyYEc8=; b=u3kxYmZg6UUL39C7GegXN3rqDQxSawb626ndYlu7254XR5VKjIeXC40+onVRewx06a SGDZaBBYcRyTlIXiVdhS2nskAXgsWruHxzS3aDP6AiyMEUAv6NjlEB5zOJwNEwGahykO +sHAiy17tltgTL/RjMSrQ1p8JrpJeREweQGGUZu5JsVvaQQfV+lnSdQH/aUxrS/p6q8i l/0TKZGciHkjm3dE7a1ZM3rT+RFFKElCVjnE+Bjz8RFyeaSaWZ7NQx9DfR72vM74Hqcc PkU7TzDGJwrxRYGq1OPPpcXr4JbbXZBnjAwd9PJz5IDhb40Ubz7QJ23Ir4AtWqKd/dXq E7vg== X-Forwarded-Encrypted: i=1; AJvYcCVulIyIEEPsCoyVdmTiYRpJRSStf8OlG1FE7e2Ae0yWuttg0X9Mg/kY3TSe2/LW+0CMgHwHnwmboCLP7yQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxCQA70rY04mKofxg8vHL+bYMEXYaOxn+2j/sL2aDxji71peW77 1FiQ6J3M2PeQGEEWcGCs36MJ3TVEgcoNW/xOaMcMmRA+DhLQTHkyeNKWKMx1CXNFBMIdEYChuBQ SDZQz60GdOP4WeioY9TsCkcvyXUdPNGSyzLiRrdcuy4xZ75EZXMRaezHJ3rWNoO6ysIA= X-Gm-Gg: AZuq6aKDmn4h83al2yrZTRkeDDo40gMfOxrFhj0Z3JU4sOzzR28VR7tSi8gtPSUAjQu i9cYQWDLAik/dyl3O2mxQOEW4f2Em1zlJp8u8Wlh9yAfCxvMuoQ00z8655OKYyOwQq2v24bqa7D d+6l6i+gFxsAyS5Zg+knemv2GJUxhXrS1OAEtMobLGrfHKhANw3D9Hk1dOdUvygxtYzEF+SI/e7 EfoBytVOXHGnY4h+P3laS3LhLdAhuaCHRgUqeoz1VrFE2yz3rCcj1sjafmqrvQ86oN7l+CjTqjl 2nQ5OiOVpQBrLjJLzMYWKkfF00S+BzEiY4wumqYSVQU31eEaJZ+PqWV8NWxa03zPWYsp3PD2xIR PTCnw2zYHvJwL40lAZywHtvhB+S3R3Zm0pK35duXobrpdaypYRkxLycAKR3ryXk1gyeM= X-Received: by 2002:a05:620a:1908:b0:8c7:17af:7ae with SMTP id af79cd13be357-8c9eb2f98acmr1116691785a.7.1770045114371; Mon, 02 Feb 2026 07:11:54 -0800 (PST) X-Received: by 2002:a05:620a:1908:b0:8c7:17af:7ae with SMTP id af79cd13be357-8c9eb2f98acmr1116685285a.7.1770045113527; Mon, 02 Feb 2026 07:11:53 -0800 (PST) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf2ed584sm897220266b.61.2026.02.02.07.11.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Feb 2026 07:11:52 -0800 (PST) Message-ID: <6fa17bda-4d4a-4b31-99a2-1d2b606b663b@oss.qualcomm.com> Date: Mon, 2 Feb 2026 16:11:51 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/3] Input: aw86938 - add driver for Awinic AW86938 To: Dmitry Torokhov 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 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> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=TaebdBQh c=1 sm=1 tr=0 ts=6980bebb cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=R3g-FwLwWl9o4qomehAA:9 a=QEXdDO2ut3YA:10 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-GUID: OxySzjbPMUPMHocdjfyB9khLGcy4OpBt X-Proofpoint-ORIG-GUID: OxySzjbPMUPMHocdjfyB9khLGcy4OpBt X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjAyMDEyMCBTYWx0ZWRfX5uW7sI5QSKDN uXmiuVN1kunvv/FtUqVCR3HorTTm+Q5v/KcqmbYte8s+pVEApU54tUpTNgTmCIjCeATKR42rsfW kx0y0wqF1XgG3OXaDJ6coUfoZ36GIeQxYWCFjF4GTgoSRF5DIYGhe1ultoMZhAgtj6fSJ0gP+3Q 3dSARYQy3QI1t3lz9hRCuGxMoii9RflcqPcslG7daBZuJRG4rMUWZ+lntdd4EHqsGBNSqc5+W6M eUKCDkW5PXsjgxQgoXN9etRdisNL6yGQVImzrwjVJBlh9LrXKDF3kHL2XNTxl2KhcMIRv3jumhB dU2C1B5h6yBuNc7Q8DF/dn4dPwUrEpLXYV7amp/ILcKPyKxFzRRzAfoSDrl2Go+ZDz9Ww5sRXfq 7n9QOE7zEkVvUePMfEm1uxa2MgIVRqKP/zwvBTy4H9TNO69X+vpiDZKVRj3uSBWPHHoD8KsYO8A YmJbt2L/riZ+L1j0/aQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-02_04,2026-01-30_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602020120 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) > >> >>> >>> 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. 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. 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 Konrad