Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp360568lql; Mon, 11 Mar 2024 05:13:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVi70Jdk2mwA9PBBJb1uw0wX07k5wJWNLyQl//IzfmOqMc6OJHTX0isNTG0pmkG8MBm798WUiGLGWuxaUGxLqBcEGWsWXKRgAVTZP8szg== X-Google-Smtp-Source: AGHT+IEHwZ5jc94sKRvmDgHElDnE8whU/cdVoxhGlbTWJrPfMnB9EGx0u/p2pR1QeSOKxjB2UKw1 X-Received: by 2002:a50:c345:0:b0:568:14f3:ebce with SMTP id q5-20020a50c345000000b0056814f3ebcemr7503986edb.12.1710159183516; Mon, 11 Mar 2024 05:13:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710159183; cv=pass; d=google.com; s=arc-20160816; b=aUSHH38HNHdk8lxrtCkt9qI2bdRdDjQ/s83o/vOPRb7jm/xZEWTS9Lzm0xcCV3Xffl 07KU8lykiO/pbhbFp6U7r59OBIht5Fu1yClwrOieTTszNAEBG4bMv80HrCuxN0Loj30i u72Kyw/MPJ3bonNW82RueeQ/fgCbpq1KyScnLOtQNw7BizVw573WSbFK0HtG95qT5JUg I5wsWg1nWOlkWCa7TDiCHhRgW8OL74G/yg8DpeF8mNnma4rwb8cLp1xm/NiWi4NGSsZn W1irpNbKAHrsGisk/9XnOBGQyxc3u4O3/KEsjjuyagfaoGtehOb19Brj3phSdlb+gEgA hwCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=f513oSfKIQNBl+NCiBkqWypTWrkqtfFoWPWTNimurcI=; fh=GZZgUb3qHjrPrsMlcMZj3RXPu3bdgppZHqwpr8O/jb8=; b=Ghucz/VJU5NlGoXNQ3WqQRGjYI7Opn2p2RY9T6+kIB/2NcGyx81b4iB1qm1026i7lo /WlNOiuP/+ddtbuzXky7FBGYvreVo8Pd9yj5qPbDlGQCYUi+hLwWtcz3hkppi/3pSD5/ 4c4ZgKICzYGi2kHAh8LHRC5uumEkp9p8jNWkvNjsCbt1UIwwFdKxGgjImaY3gz7LJB4Y P5YYfgK3KXHTLhq7BIYELte7nwB1cNUd6OEjVdYBm2Jzok0w5ImShCmvYQqkYli7daj6 85F9iMmPQrXOc/yHVc6+WrmDEvA/9e+GNdW+gftjN0O77Eh3L0PpWIzSVGNjce4+pyoB 5pLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gimli.ms.mff.cuni.cz header.s=gen1 header.b=VtMkRhEH; arc=pass (i=1 spf=pass spfdomain=gimli.ms.mff.cuni.cz dkim=pass dkdomain=gimli.ms.mff.cuni.cz dmarc=pass fromdomain=gimli.ms.mff.cuni.cz); spf=pass (google.com: domain of linux-kernel+bounces-98809-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98809-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gimli.ms.mff.cuni.cz Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id co16-20020a0564020c1000b005649f9ea4c2si2417901edb.507.2024.03.11.05.13.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 05:13:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98809-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gimli.ms.mff.cuni.cz header.s=gen1 header.b=VtMkRhEH; arc=pass (i=1 spf=pass spfdomain=gimli.ms.mff.cuni.cz dkim=pass dkdomain=gimli.ms.mff.cuni.cz dmarc=pass fromdomain=gimli.ms.mff.cuni.cz); spf=pass (google.com: domain of linux-kernel+bounces-98809-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98809-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gimli.ms.mff.cuni.cz 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 186801F20B66 for ; Mon, 11 Mar 2024 12:13:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C3EA3D984; Mon, 11 Mar 2024 12:12:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=gimli.ms.mff.cuni.cz header.i=@gimli.ms.mff.cuni.cz header.b="VtMkRhEH" Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) (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 6BB533D0A3; Mon, 11 Mar 2024 12:12:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.113.20.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710159154; cv=none; b=enTuLry7kKOLm45kp6DFo8ZCARYN+fI5iVJsq5OSi5//SLRofIqHKbYfGLq9PVivIGpJyquSFPEgDhv/3uiQVDi2Rvcaj0fcilpSfRZwwV5wDhfBhDoN31g8Sm62oDW9slyI4oYNbRBO+PL3wc4OaRIUpz/omBqd9Y5z6mQlXFU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710159154; c=relaxed/simple; bh=U3LEf9gcvb9qBbv5Ydgi8wGMo6Un0VZqLowtuSb4FXg=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:To:From: References:In-Reply-To; b=UzcQFgCAQMxTuS583AJ62K5hWatLc1Ajoj/QN1gTNC596dsEvLkil0gbEUKxMdy674w9Lu6MfmH4ElI0CgnrZjiqHWGA+wrSHZEJd3QNF1C/WG7uCLraeezGK0rjSFrS05fUxZDxf/ySG9ZRliLsKeIfPASZq+fnLEW0cle1R04= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gimli.ms.mff.cuni.cz; spf=pass smtp.mailfrom=gimli.ms.mff.cuni.cz; dkim=pass (1024-bit key) header.d=gimli.ms.mff.cuni.cz header.i=@gimli.ms.mff.cuni.cz header.b=VtMkRhEH; arc=none smtp.client-ip=195.113.20.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gimli.ms.mff.cuni.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gimli.ms.mff.cuni.cz Received: from gimli.ms.mff.cuni.cz (gimli.ms.mff.cuni.cz [195.113.20.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by nikam.ms.mff.cuni.cz (Postfix) with ESMTPS id 306782846EE; Mon, 11 Mar 2024 13:12:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gimli.ms.mff.cuni.cz; s=gen1; t=1710159142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f513oSfKIQNBl+NCiBkqWypTWrkqtfFoWPWTNimurcI=; b=VtMkRhEH7lirmCfZ6lq4ZfqNkpmbutYBTmxMKv7B6+8uy+PWmIJVGoz6aUTKckFA49V3Uk xVqZGtc6OGuS8HS+HgMFhiZtlj0iG+MVG56uUx5hgHXDPJI4HrXs9NorCIl7GCXZRkbOf5 yrsggvESPQo1v7rVvqmYvy1Ueh/JOsQ= Received: from localhost (koleje-wifi-0013.koleje.cuni.cz [78.128.191.13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: karelb) by gimli.ms.mff.cuni.cz (Postfix) with ESMTPSA id 0C223459710; Mon, 11 Mar 2024 13:12:22 +0100 (CET) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 11 Mar 2024 13:12:58 +0100 Message-Id: Cc: "Lee Jones" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Liam Girdwood" , "Mark Brown" , , , , =?utf-8?q?Duje_Mihanovi=C4=87?= , <~postmarketos/upstreaming@lists.sr.ht>, Subject: Re: [RFC PATCH v3 4/5] input: add onkey driver for Marvell 88PM886 PMIC To: "Krzysztof Kozlowski" , "Dmitry Torokhov" From: "Karel Balej" References: <20240303101506.4187-1-karelb@gimli.ms.mff.cuni.cz> <20240303101506.4187-5-karelb@gimli.ms.mff.cuni.cz> <3601a374-4161-40e1-8a80-9bbfdae5bd8a@linaro.org> In-Reply-To: Krzysztof Kozlowski, 2024-03-11T11:41:53+01:00: > On 11/03/2024 11:26, Karel Balej wrote: > > Krzysztof Kozlowski, 2024-03-10T21:35:36+01:00: > >> On 10/03/2024 12:35, Karel Balej wrote: > >>> Dmitry Torokhov, 2024-03-04T17:10:59-08:00: > >>>> On Mon, Mar 04, 2024 at 09:28:45PM +0100, Karel Balej wrote: > >>>>> Dmitry, > >>>>> > >>>>> Dmitry Torokhov, 2024-03-03T12:39:46-08:00: > >>>>>> On Sun, Mar 03, 2024 at 11:04:25AM +0100, Karel Balej wrote: > >>>>>>> From: Karel Balej > >>>>>>> > >>>>>>> Marvell 88PM886 PMIC provides onkey among other things. Add clien= t > >>>>>>> driver to handle it. The driver currently only provides a basic s= upport > >>>>>>> omitting additional functions found in the vendor version, such a= s long > >>>>>>> onkey and GPIO integration. > >>>>>>> > >>>>>>> Signed-off-by: Karel Balej > >>>>>>> --- > >>>>>>> > >>>>>>> Notes: > >>>>>>> RFC v3: > >>>>>>> - Drop wakeup-source. > >>>>>>> RFC v2: > >>>>>>> - Address Dmitry's feedback: > >>>>>>> - Sort includes alphabetically. > >>>>>>> - Drop onkey->irq. > >>>>>>> - ret -> err in irq_handler and no initialization. > >>>>>>> - Break long lines and other formatting. > >>>>>>> - Do not clobber platform_get_irq error. > >>>>>>> - Do not set device parent manually. > >>>>>>> - Use input_set_capability. > >>>>>>> - Use the wakeup-source DT property. > >>>>>>> - Drop of_match_table. > >>>>>> > >>>>>> I only said that you should not be using of_match_ptr(), but you s= till > >>>>>> need to have of_match_table set and have MODULE_DEVICE_TABLE() for= the > >>>>>> proper module loading support. > >>>>> > >>>>> I removed of_match_table because I no longer need compatible for th= is -- > >>>>> there are no device tree properties and the driver is being instant= iated > >>>>> by the MFD driver. > >>>>> > >>>>> Is the MODULE_DEVICE_TABLE() entry needed for the driver to probe w= hen > >>>>> compiled as module? If that is the case, given what I write above, = am I > >>>>> correct that MODULE_DEVICE_TABLE(platform,...) would be the right t= hing > >>>>> to use here? > >>>> > >>>> Yes, if uevent generated for the device is "platform:" then > >>>> MODULE_DEVICE_TABLE(platform,...) will suffice. I am not sure how MF= D > >>>> sets it up (OF modalias or platform), but you should be able to chec= k > >>>> the format looking at the "uevent" attribute for your device in sysf= s > >>>> (/sys/devices/bus/platform/...).=20 > >>> > >>> The uevent is indeed platform. > >>> > >>> But since there is only one device, perhaps having a device table is > >>> superfluous and using `MODULE_ALIAS("platform:88pm886-onkey")` is mor= e > >>> fitting? > >> > >> Adding aliases for standard IDs and standard cases is almost never > >> correct. If you need module alias, it means your ID table is wrong (or > >> missing, which is usually wrong). > >> > >>> > >>> Although I don't understand why this is even necessary when the drive= r > >>> name is such and the module is registered using > >>> `module_platform_driver`... > >> > >> ID table and MODULE_DEVICE_TABLE() are necessary for modprobe to work. > >=20 > > I think I understand the practical reasons. My point was that I would > > expect the alias to be added automatically even in the case that the > > device table is absent based solely on the driver name and the > > registration method (*module*_*platform*_driver). Why is that not the > > case? Obviously the driver name matching the mfd_cell name is sufficien= t > > You mean add it automatically by macro-magic based on presence of > id_table and/or of_match_table? Yes, that plus: if id_table is present, use that for module aliases, otherwise use driver name. In fact, I checked the platform core and it seems to proceed in exactly this way when determining whether there is a match. And while autoloading and probing are two different things, I assume that we always want to consider a module for autoloading when we know that it will probe because we have a compatible device. > That's a good question. I cannot find answer why not, except that maybe > no one ever wrote it... > > > > for the driver to probe when it is built in so the name does seem to > > serve as some identification for the device just as a device table entr= y > > would. > >=20 > > Furthermore, drivers/input/serio/ioc3kbd.c does not seem to have an ID > > table either, nor a MODULE_ALIAS -- is that a mistake? If not, what > > mechanism causes the driver to probe when compiled as a module? It seem= s > > You are now mixing two different things: probing of driver (so bind) and > module auto-loading. Yes, sorry, I meant autoloading. > Probing is done also by driver name. Auto-loading, > not sure, maybe by name as well? Well probably not, otherwise it would work here too, no? Unless there are some fundamental differences in this between PCI and platform drivers. But the input driver is platform too and is required through the MFD cell, so I think it should be the same scenario. > However it is also likely that > auto-loading is broken. Several drivers had such issues in the past. OK, I see, thank you. I think this was the main source of my confusion because I looked at other drivers for reference when trying to understand which properties (name/device table) are necessary for what action (probing/autoloading). > Best regards, > Krzysztof Thank you again, kind regards, K. B.