Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp306176lql; Mon, 11 Mar 2024 03:25:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVY9ipb98wrRL1VVFZv/ydlRwH9B4HzzZmF5H8OTbxJyxXYUFM9EmNbKQx7V4M37gP4SdjOxUX0XmFleY5jFqn6vQFcd+Z0WinvLuUqEQ== X-Google-Smtp-Source: AGHT+IEr/r+HrfuuIYqUMB4FWBmbgPmHI6rkusy7yboPibSwwMiR4dCOmQLlFsXX1vmrzE//U0y8 X-Received: by 2002:a25:bb09:0:b0:dcc:f3fe:19c with SMTP id z9-20020a25bb09000000b00dccf3fe019cmr3779364ybg.59.1710152757156; Mon, 11 Mar 2024 03:25:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710152757; cv=pass; d=google.com; s=arc-20160816; b=Jy0GzI9v5kChMuqQyQ+55LZ+wL861qKdnyicT6YK79VpJ325GZig6kivTS2tTr96hS ktgeCgxGudzfDZzgl0WQ+Y+7VVByUmrmNc1PvKV6B34cNrSIyUAbWG3mabBd17fK0vVu wc9ofwIHUdh6C9eKvuwq5nF6N5MXj6B2FNcfDpcGTX9bNDmcuLbjfhnxtHtWDC39wvG5 D0tkB3ayLCRWh0lGN/mWV4n0SOwQB1TYL7eZwKyRni7uczByzruPsdkAaDoETPrmkqML Za4De8+AhGJyv/qkO1BGmfn6BbGIuNNRC3asv7hMl+kzMK9StAbvyV1fd8ync9g509cB ZzZw== 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=H//5iIeYe7oQRy/0AyjUfWh+gF2wOrcp5xlLc4v3Q74=; fh=GZZgUb3qHjrPrsMlcMZj3RXPu3bdgppZHqwpr8O/jb8=; b=VIJVMgIcvWqPDI3UUhg9Xw5wsDvz84IV4aELhvs+d80iakAgg11+nGmlHbygM7bghu 385mQngacl/HSRIUcaYDx9KqPQc3Q2VsuI/WD9D1G2sSqmKrKiZ9Pl/wpm4kZj7+/WP+ ZzJ1JeXyTpIC/6jp4dfwkAzCSpuN6AZ36G8Jl1ueOdbDfNHjC80iDiz5JtCP1FUU5aFI fA2nDL0V7CR/908nYHCKTqp2+cRTVhr+/BwZ4EVxNXCdihYurIM/rfT/vb6s3PPUW7js g9LnkVAirP0FkCJgjRd7DYMAlkv4pR7U9OrnllXW+4emAQ9y33AeUYsvl9KTt1mdXgik aJkQ==; 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=fZEQPrZM; 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-98696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98696-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 ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y11-20020a05622a004b00b0042ef2db7208si5190300qtw.286.2024.03.11.03.25.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 03:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gimli.ms.mff.cuni.cz header.s=gen1 header.b=fZEQPrZM; 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-98696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98696-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CDB7F1C2026E for ; Mon, 11 Mar 2024 10:25:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D6EB2DF84; Mon, 11 Mar 2024 10:25:48 +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="fZEQPrZM" 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 D372617577; Mon, 11 Mar 2024 10:25:42 +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=1710152747; cv=none; b=GdKRtljvJ9Ds5vPAggOc/tLUadJrgqjkFKQtgoSgjoApKsBJesuNCMqj9haH4RnbqzA68pRxblNFY8ag42X8fZHDMBGuw6nShxsSTC/PsT9ELDOJCMgQT8EIM49PQIqIioRMBxtkYMSlJvuZlbkr234U4xyYNBT2agLa1rcfLgg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710152747; c=relaxed/simple; bh=Z7zEDmtLcGezCOC/ZaSnA49BYLacuUO+5ZVKZot6wSQ=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:To:From: References:In-Reply-To; b=Sef7hXX8KS0HhwiqJyaMY2ChHAWIXs0cE4qb3TfJZp5HQBIOwfBU/Be4ST2tBgS61F+8h4TjwxDSZG8QNrFjm4S3argLZobePO1LGzwdDjEWNGTaudMzXkKL5KdjqmEciGMk3HHvYY/AHjvmkc/ds4BlGTWU8y4qntSmxAcGDQo= 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=fZEQPrZM; 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 9CE062846D9; Mon, 11 Mar 2024 11:25:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gimli.ms.mff.cuni.cz; s=gen1; t=1710152740; 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=H//5iIeYe7oQRy/0AyjUfWh+gF2wOrcp5xlLc4v3Q74=; b=fZEQPrZMk4AgF+2d7bv0M/4Uyp/cv8UvfL7w2ytblEIuziBl5U9idaSh+7WVs+zUka3q67 IPh9PjeXSPww1ZF3qlW929xPMl6uW3s0haBQ02NuCFngt5VLAyDpViSpiuzhjVKn6tqANh zt1j6r7ji8bV6rvH0lecqrF7BWf6nEc= Received: from localhost (unknown [213.235.133.102]) (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 5B8F5457B68; Mon, 11 Mar 2024 11:25:40 +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 11:26:16 +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: <3601a374-4161-40e1-8a80-9bbfdae5bd8a@linaro.org> 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 client > >>>>> driver to handle it. The driver currently only provides a basic sup= port > >>>>> omitting additional functions found in the vendor version, such as = 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 sti= ll > >>>> need to have of_match_table set and have MODULE_DEVICE_TABLE() for t= he > >>>> proper module loading support. > >>> > >>> I removed of_match_table because I no longer need compatible for this= -- > >>> there are no device tree properties and the driver is being instantia= ted > >>> by the MFD driver. > >>> > >>> Is the MODULE_DEVICE_TABLE() entry needed for the driver to probe whe= n > >>> 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 thi= ng > >>> to use here? > >> > >> Yes, if uevent generated for the device is "platform:" then > >> MODULE_DEVICE_TABLE(platform,...) will suffice. I am not sure how MFD > >> sets it up (OF modalias or platform), but you should be able to check > >> the format looking at the "uevent" attribute for your device in sysfs > >> (/sys/devices/bus/platform/...).=20 > >=20 > > The uevent is indeed platform. > >=20 > > But since there is only one device, perhaps having a device table is > > superfluous and using `MODULE_ALIAS("platform:88pm886-onkey")` is more > > 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). > > >=20 > > Although I don't understand why this is even necessary when the driver > > name is such and the module is registered using > > `module_platform_driver`... > > ID table and MODULE_DEVICE_TABLE() are necessary for modprobe to work. 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 sufficient 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 entry would. 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 seems to me to effectively be the same setup as with my driver and that does not load automatically (because of the missing alias). > Just run `modinfo`. Thank you very much, K. B.