From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 E98303BB36 for ; Mon, 11 Mar 2024 10:41:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710153720; cv=none; b=E6JpI7kZsGYM5DV2BUH+yc7wUe5jgp8u/EKfogP+xiNAPe7woVheCu5mb499URSKFeIUifkBm8AHcB5XgUiepZqhTVtS+Ab7QLyl+XueB2DkqFulgwaEArfmcTWycvkkb2FXbAnclYVmDoPz0VB/T9aZ2ASVCaXkWiEW6EYCLrY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710153720; c=relaxed/simple; bh=et6D94mdf5IbFO5VCgJsMEQNnAvoLbUEsq4t5Pwu4w0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VDYaQiLqUmoNnGDgBf5nOt8RWBAiydynlBS/QP5tQQFVimJ4GReQBuaIl55DKk2N9eE73P0cTrEaBRLDDEl6HVGyYQ8+N0fmNs8WfOQhFDFOAY8S+rjxRdN/Ww0N0oy2hJa+DmqPLdSsl2aODqW2y7VoWUimdmQ2YP2hghpRNKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=xTOOVog9; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xTOOVog9" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4132953e13dso4808545e9.3 for ; Mon, 11 Mar 2024 03:41:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710153716; x=1710758516; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=AQyzC1WPTXWjYhSQFz0zRBD57MnVVABdhNoOa0rY8dQ=; b=xTOOVog9qberFTbrDZeJN9Xv1ROAp6giBhHajZ03J/ysiF82AVIBDZd/TrDFskSlbJ /apL0jAeCnFJOxm8RkU5JxHlNkqI8cNg+cbzMHcm01++zFt+uM2QyUrly1H24ufUtNUU mCgrijd28laK5IDKhZdYAVU9swmg3XJSL6DC1pQUb6zey7VU2BvvwdAd2i9FtdecknIJ T8Eq2lZjkUtEjCDAL4+saEtxaUHoiVK3MYiQFMEF+rWOXAxNCZ7JeIpb+Q6Jhhgo2he7 T22I3+rFcAnJV8eKsazqm71/CTkzEtU6GyDqflAoOPcVc5BRdKpNFpe74/GLKbgOC2mA B5lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710153716; x=1710758516; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AQyzC1WPTXWjYhSQFz0zRBD57MnVVABdhNoOa0rY8dQ=; b=AE0wooPlBKkxwS2gFj64eZXjv8uRczlOCAo6qriLFTA8AVxdVy+/F9yaVnMDXkJ7je hqkk47xxgJ+S5AEevzDmKV/9BacVg13em8qdvwMLfHrnUf+tuSTefgMUUHxLKis7XtXT N7LJZzGO8JKZUE/vhVvwZ28toILgRmTJ26lIXHbPZgZIU88jI/wfPjQq46L0GkIgETzq 7Q+iu1TCALTTGoaXja6Dw22pOpPLP2apFRYV5J3KpTGkrsLBRfSEJsEOZLRKsNfl61O/ gaMLK0Sl/rvKC7bayUYZtR6Swf5qJD2teM4CtNPahf8+FCBQ7DF4hAQKkxs0KpWpQ3vr vdKg== X-Forwarded-Encrypted: i=1; AJvYcCVs67X4x9dSp95n90en6qKKpOvUuLeflYL8I9L5J9qtgFQPeYaV/4VbZ+33cPMohMn2cVzq1bGrhuZLjgeN00VXqnrMRTwV39OAd3I= X-Gm-Message-State: AOJu0YzTpXG7zEZZeeK7rMO28a1UaxTXhGjOrBN0Ek2yx3DGA575zA/a VSUzl2gTUDIqaTjgU+aXcAEULGNKg0gFC1q7XVLW+WcQg1oIxt7aDT+yw5OnLDs= X-Google-Smtp-Source: AGHT+IFT03qszUVNn4EMvc9bfZpRC1OJms3x/bryvZ634XRq/o92hf1cWh+g5Ncbuqp0DqnkRyye0Q== X-Received: by 2002:a05:600c:538c:b0:413:7b2:284d with SMTP id hg12-20020a05600c538c00b0041307b2284dmr4579612wmb.36.1710153716297; Mon, 11 Mar 2024 03:41:56 -0700 (PDT) Received: from [192.168.1.20] ([178.197.222.97]) by smtp.gmail.com with ESMTPSA id c18-20020a5d4152000000b0033e745176f5sm6102234wrq.110.2024.03.11.03.41.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Mar 2024 03:41:55 -0700 (PDT) Message-ID: Date: Mon, 11 Mar 2024 11:41:53 +0100 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v3 4/5] input: add onkey driver for Marvell 88PM886 PMIC Content-Language: en-US To: Karel Balej , Dmitry Torokhov Cc: 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, =?UTF-8?Q?Duje_Mihanovi=C4=87?= , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org 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> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp5c3p0b2Yg S296bG93c2tpIDxrcnp5c3p0b2Yua296bG93c2tpQGxpbmFyby5vcmc+wsGUBBMBCgA+FiEE m9B+DgxR+NWWd7dUG5NDfTtBYpsFAmI+B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svv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 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. > > 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 You mean add it automatically by macro-magic based on presence of id_table and/or of_match_table? 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 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 You are now mixing two different things: probing of driver (so bind) and module auto-loading. Probing is done also by driver name. Auto-loading, not sure, maybe by name as well? However it is also likely that auto-loading is broken. Several drivers had such issues in the past. Best regards, Krzysztof