Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp74783lql; Sun, 10 Mar 2024 14:49:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVy1pjyVXkMNkVpBvikakonRXnuKzlSdKsxVaXRdTihdgT7/X1UMDRvfsTKmcvyQNWoH0fxsEo1Ea8ZduByHFZRSKKPVltcsk90Ia/Vjg== X-Google-Smtp-Source: AGHT+IH6t1LpT7V9IFlTZmYxOmo0iaIW+fbArM+n2V/EeFD0FxirUy/Np30VHK+aTKhpUoXG2Hko X-Received: by 2002:a05:622a:3d1:b0:42f:1556:4e85 with SMTP id k17-20020a05622a03d100b0042f15564e85mr6852151qtx.5.1710107349960; Sun, 10 Mar 2024 14:49:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710107349; cv=pass; d=google.com; s=arc-20160816; b=FGTCYwbt4ggRjpq7jWAigTfNYsiGX7r0+hcBU2GS8HfPyYIEJwO/rekEto4cxZDioz AYoYnQyWWWGbVNaSRc1bIe86sWCfbjU2bgdV+P4VdjwBTztueVCaKHerLXfDQQj6xeIT a4TdYoRsaUD3uFRRO//uXFTQI5UpBTQwDNZDNl7d/bf8oFjU+FdCp6Dsdl8VxGMjIZr4 /18+gWNM7cxa4iDefl/fZm4+6U6QTBBfNaAJskDdq7dfoSHQ0L6esJU5ux2A/5h6IbuC e9YxmNKKU7xbbrsLGadNeKRVGR8FUKLvXcre+MUPCfWL50wfDNryyA9yIJA1rVwEffTm fPoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=peiS13bUuIETlTVlJrUnJS9cAypcX9YXgZEjm2ZHlXk=; fh=+8RWz1glWpI9FbgyRKfkxePLt5bkbTM62hEZ4Sb0MuM=; b=iRK4bjSiiyGfVEvHtOa16VQY3R/2HYxaDk19KZDeHQTzNQDrU4K/csMwhSRU/pDHmO q9vRL0klFvYIyGwTvZ9ETB8fBadRvTL+5lU4a/ZaR/B4ZJuGesMkAol6jKhge/Mh+Jr5 AbVJr6cmPUB7nw8ZY+5FD160DjshX7in94VMl9bPqEQJ5DIBWs5Y/6/hbS4XR3fp5ZwE MaqXfewC1Zht6kq2IaZwwON2pLCEmDQ/egsEwSVXfer4icGIUv6+8ln7vXH3WV4UJWPU jT/6OoNQmKzWaK98SLLBMD+Q6FgKVaX7HHQhQAOVi5QB1AAr/5RBYeS29Xy3CwubsHkJ BInQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EGQVc6i2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-98343-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q5-20020a05622a030500b0042f27d19323si4231299qtw.538.2024.03.10.14.49.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 14:49:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98343-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=@gmail.com header.s=20230601 header.b=EGQVc6i2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-98343-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 9C7B71C20EC8 for ; Sun, 10 Mar 2024 21:49:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 391883A8CC; Sun, 10 Mar 2024 21:49:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EGQVc6i2" Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 6E354200A6; Sun, 10 Mar 2024 21:48:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710107341; cv=none; b=oDnGNrpkdnEHiv1mRDfKCojnRq/gzf7QkyFo4EyGeEuMPIoE6Twc+AZH42n/fOF2qPhshSlkGrbodMXiGA1U3481lcSYFpzwveL1+8GbLp4DlMFq0mlr4BLgCyd8r4MPCkiwirJ2kE4x4BrIs1REDkl9LDzcw3npB4G8BJHSmZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710107341; c=relaxed/simple; bh=uiNUIQwX6BYiGbEKIo6u+t0/etIbRR33V5TSPTk94m0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SYKIs5ydFn0rpQMuIsp6Ux3M+sHgfeQwo1asr74tpf4NaM+jsUdFmcG7Jsb/WVkayvpBQM8HVlGdU3IIYeXzA5aO/xS7/Efa5e1JJNiGXBzHG4+G4OvyFbTDTO2YKGhdUCROTRMrw4O80A53TIT0q9z6gO/SP1DnUZmX2vOOpaQ= 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=EGQVc6i2; arc=none smtp.client-ip=209.85.214.172 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 Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1dd68d4cff1so16395875ad.2; Sun, 10 Mar 2024 14:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710107338; x=1710712138; 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=peiS13bUuIETlTVlJrUnJS9cAypcX9YXgZEjm2ZHlXk=; b=EGQVc6i2U7tItUa2Prnhd0di4K5hx19ZKfAM4A95LRb5bllQziS8Yv5sA6SaDJ+cZB fJCc3O5K4GO1Qc3/SeP79oKt96JKvrqkaNOHUBkADrQYFtcCrVS/E9JKp6npfTcc55Y0 m/WuhA6asZpOO2Mc05Uf/5ARtNdH5Oy1rew/JukU98Eaz35W+GA9Zsab8W1aAu+THtJ5 DP+/GxSHb9a5vquYivEvwU2iM/oq57sdWSPpi0GteTPPHe2ob0ovffxsKEd5QsYYfSUO zwMJk4Qx5n9sLbF/1qz6avXyIIN+VvBJ0Cv7j/53ya7tpUIq3CRdAVcT+kr3jTzfpyZe 6u8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710107338; x=1710712138; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=peiS13bUuIETlTVlJrUnJS9cAypcX9YXgZEjm2ZHlXk=; b=hMJqZYJ+rokbgt02arEW39IiC17ArDzGno2UNWUeqdwl1uss8aQSVr95Wy3o51lhER VETRrkyhBa/6dux+zXIHBW/NkHww7WK/Z8DFerB0stzpD/tcdCnoE5E+J8/q9Vd0ysXd AfZCPiFt4EMo6gNP+jt7Qkwhnc9kZALTET+SEZVQM1Ap4JiZsGybDxKl7ZMCdNlk8tnc RZnYVcGeeIpe4kLaEeUkSvZnw7ZLfVCZRi0GSBmCpAwKc2STZWzEoP4jLZjYg+muGpMl vvC50EWqiCrdh4lHIyPEgvxkiDzxrhuNirdHAwf0Q3MNTZ9LzU0i/AG27sFsBUwyhQry hGAQ== X-Forwarded-Encrypted: i=1; AJvYcCVy1e/no/CCS/nnyCa3GSliKamgxdZN4oaNnHXqVpgqMBGhkj+T6XCB3AqzSyky4smZIs4/ymjArE3E1phNjbLGFuPUqPwR2ulLvDgIk4VIUdoN441fahY6w57qKTLCEVhwqtiFeTJ57z46ndviH4A2nHGzabjvvXm/enezBkotq1KCugUAMpYRMlxExZ/rYVRFP9WIEvLBDDKijL8WVzQq9x8= X-Gm-Message-State: AOJu0Ywoj0EvC7WuJ4d6x8+/jVPbyAns8T6ZdUyN3+w9OTGkAdFUYdf2 yCc7MApmopr377EhrSD3AqNQ+f9M3T0lRSVBn49p2++Kq2MM67enkkghRCeI X-Received: by 2002:a17:902:e5ca:b0:1dd:a36e:3204 with SMTP id u10-20020a170902e5ca00b001dda36e3204mr47580plf.67.1710107338535; Sun, 10 Mar 2024 14:48:58 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:fa9b:d52c:840:abd4]) by smtp.gmail.com with ESMTPSA id n9-20020a170902e54900b001d949393c50sm3120067plf.187.2024.03.10.14.48.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 14:48:58 -0700 (PDT) Date: Sun, 10 Mar 2024 14:48:55 -0700 From: Dmitry Torokhov To: Krzysztof Kozlowski Cc: Karel Balej , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Duje =?utf-8?Q?Mihanovi=C4=87?= , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org Subject: Re: [RFC PATCH v3 4/5] input: add onkey driver for Marvell 88PM886 PMIC Message-ID: 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> 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: <3601a374-4161-40e1-8a80-9bbfdae5bd8a@linaro.org> On Sun, Mar 10, 2024 at 09:35:36PM +0100, Krzysztof Kozlowski wrote: > 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 support > >>>>> 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 still > >>>> 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 this -- > >>> there are no device tree properties and the driver is being instantiated > >>> by the MFD driver. > >>> > >>> Is the MODULE_DEVICE_TABLE() entry needed for the driver to probe when > >>> 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 thing > >>> 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/...). > > > > 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 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). > > > > > 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. > Just run `modinfo`. MODULE_DEVICE_TABLE() and MODULE_ALIAS() reduce to the same thing, but I agree that we should not try to be too clever and simply use the ID table. Thanks. -- Dmitry