From patchwork Fri Oct 6 10:03:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 149172 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp208065vqo; Fri, 6 Oct 2023 03:04:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmLdc3E6BokLqwa2CKCRToXgpnCSOOUFnfqF0/KRO+uYdFIe5LsESUkoogADgARP1ztm81 X-Received: by 2002:a05:6a20:5602:b0:16b:9285:69e6 with SMTP id ir2-20020a056a20560200b0016b928569e6mr1372137pzc.35.1696586644620; Fri, 06 Oct 2023 03:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696586644; cv=none; d=google.com; s=arc-20160816; b=mpQ2qZbDn7tF1xxOhQBNbiwuZrcqF4HGKBrk157ZFOWOp6qSmFA+Q5yK6Uo/Nv8JWd L+RM3nuVCayZEEQagcgYoFViiJkgLlYocG+S9ju1vpm0ZkTjkQs0vxVdr14Qsy9CCtQd YPco7K+L+gCCy5PVP8PY8mguFRooi3gFuwPc3HRAIFKsTPzRWUOJY4XGe/J9w1Km/pk8 AyzceQK8T2JN9a/rZUTzFnKdc0hsDfHnHVeSxEJCHLD45sx1VqmGaDDHfe00nkAqOPlK VVk9jPpV9mcfUL4QU59YDfUlfNO9uWoYsYWX6q9GR/zuP4PZBduGkGzVG9DcxB+b9VU3 nnnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=26Lv+is9OakJ4x7WmOArKP1bVEUcRhQ+PNABYJruimA=; fh=XaFngp9HUoc2OeIT2yVx7W6ty4KrjU69hIydwZmzDKw=; b=xo/7djT/C8A2GFGPzUdd/XDPHS3AMQZRFG1nb8eMabZQafS2tfCZB/z4cc0QYo5Vi8 m5Sb/6iWfn1ADbRretvCXcBagheS4UTd1E0Vg1Dm3yCRjznlVpZZ5ivNfG7/y1WjnJ1K A+cL8gSsOaZLHUjPVKJd/WDvdBeE/bU60VyqBoBLI9NvAt9V6eTnwNRaj6HvpDisxlz9 mphNNDj5Emlm2LAZ5PEkC86qCySFJ+wcjjRabVM9ZWBDAKSoCS+3WMo20zYlSeuiBX5m sxnRz4oIrUUCDDeK4FSWFe4yii7zJWv0+wT5AdTSQ6YqlHS63nGHJnt85uQ+xzIv9Ibf d+pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="MNX202t/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id lb13-20020a170902fa4d00b001b8a4519706si3200169plb.19.2023.10.06.03.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 03:04:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="MNX202t/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 3F9F58377246; Fri, 6 Oct 2023 03:04:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231583AbjJFKDi (ORCPT + 18 others); Fri, 6 Oct 2023 06:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbjJFKDh (ORCPT ); Fri, 6 Oct 2023 06:03:37 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 873239F for ; Fri, 6 Oct 2023 03:03:35 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231006100331euoutp028bc936c182d7c3bc38760ad6860704f0~LfIjYeir10621906219euoutp02T for ; Fri, 6 Oct 2023 10:03:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231006100331euoutp028bc936c182d7c3bc38760ad6860704f0~LfIjYeir10621906219euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1696586611; bh=26Lv+is9OakJ4x7WmOArKP1bVEUcRhQ+PNABYJruimA=; h=From:To:Cc:Subject:Date:References:From; b=MNX202t/lPaJW2/nRGgKMAZbdaY2kTNdnJi1snu9xYQ/9qnLqS9brwm1pktJnHeMw MdSalX71m+rdbATVhTwkvuj2OvMIMlvIneCOSHgCsPbydr47v7Mp+C3tfV6LXboy+Y rimoXwAj8FGfoU3zkDie7ghrN0f0rpkBpcuODB14= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20231006100331eucas1p299bd17717fc99cb7d1a396ccabb5bb79~LfIjDikqN2220722207eucas1p2H; Fri, 6 Oct 2023 10:03:31 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 75.D3.42423.37BDF156; Fri, 6 Oct 2023 11:03:31 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231006100330eucas1p2c874f582336ed1de4dc1cd759c452ce2~LfIikuRin2220722207eucas1p2G; Fri, 6 Oct 2023 10:03:30 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231006100330eusmtrp10bd268b7432e420a68f9d8518074625c~LfIikKXZb2314123141eusmtrp1c; Fri, 6 Oct 2023 10:03:30 +0000 (GMT) X-AuditID: cbfec7f2-a3bff7000002a5b7-20-651fdb73496a Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 45.10.10549.27BDF156; Fri, 6 Oct 2023 11:03:30 +0100 (BST) Received: from AMDC4653.digital.local (unknown [106.120.51.32]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231006100330eusmtip2f3873f0c5b193a98db11e42c48717521~LfIiMf0Rj0569705697eusmtip2W; Fri, 6 Oct 2023 10:03:30 +0000 (GMT) From: Marek Szyprowski To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Dmitry Torokhov , Krzysztof Kozlowski Subject: [PATCH v2] Input: max77693-haptic - add device-tree compatible strings Date: Fri, 6 Oct 2023 12:03:20 +0200 Message-Id: <20231006100320.2908210-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42LZduznOd3i2/KpBv0TxSwOL3rBaLH39VZ2 i5ufvrFaXN41h81i7ZG77A6sHjtn3WX3uHNtD5tH35ZVjB6fN8kFsERx2aSk5mSWpRbp2yVw ZVz+P5Gx4IxAxdLuQ8wNjB18XYycHBICJhI7/1xl7GLk4hASWMEo8fz1FSYI5wujxNsVPawQ zmdGiUNn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iqXdh5gbGDv4 uhg5OSQETCRmXfjM2MXIxSEksJRRYt/lJcwQCRmJk9MaWCFsYYk/17rYIIo+MUrcPzCbHSTB JmAo0fUWJMHJISJgL3H4zRoWkCJmgWmMEnNX/GMCSQgL+EusfzyfEcRmEVCVeHr7B1icF6ih rWEhC8QGeYn9B88yQ8QFJU7OfAIWZwaKN2+dzTyBkW8WktQsJKkFjEyrGEVSS4tz03OLDfWK E3OLS/PS9ZLzczcxAgN527Gfm3cwznv1Ue8QIxMH4yFGCQ5mJRHe9AaZVCHelMTKqtSi/Pii 0pzU4kOMpkD3TWSWEk3OB8ZSXkm8oZmBqaGJmaWBqaWZsZI4r2dBR6KQQHpiSWp2ampBahFM HxMHp1QDk9vu0tzi3q9nDU5c2tmu2zMvkDvpaXKbfrRe+bOyu5/u8M7iePn11BKGN0oci44o GTrwmvffF7m6z6a5x/rIihdVYik53GJPjvTvuH51ltm9z7VZzFZWCjuMTyv87WHhX/Z5wpWI /z9fF8kHZmqVXUlNc+5yXro0nstBJeJAvKFtfu9U2e1pfx+x3Crs76ictTBU0k5Kw8Oh1Ub+ m9adrLnLomp/tbtfuV/3wmUtpyuz5TZvrwCvCkPP86zzZ6yTb+Y4+t/Oak/Tr5A8WdNj2ctl XtsEFFXM0UoqOysn7KjT4d3vrCn3ZG70jgufA1fP/npZwOvHq/lT513fbPZQO6duz9YfPlX7 2FlmROUosRRnJBpqMRcVJwIAIFBl5O0CAAA= X-CMS-MailID: 20231006100330eucas1p2c874f582336ed1de4dc1cd759c452ce2 X-Msg-Generator: CA X-RootMTR: 20231006100330eucas1p2c874f582336ed1de4dc1cd759c452ce2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231006100330eucas1p2c874f582336ed1de4dc1cd759c452ce2 References: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 06 Oct 2023 03:04:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779000037593456977 X-GMAIL-MSGID: 1779000037593456977 Add the needed device-tree compatible strings to the MAX77693 haptic driver, so it can be automatically loaded when compiled as a kernel module and given device-tree contains separate (i.e. 'motor-driver') node under the main PMIC node. When device is instantiated from device-tree, the driver data cannot be read via platform_get_device_id(), so get device type from the parent MFD device instead, what works for both cases. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski --- drivers/input/misc/max77693-haptic.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/max77693-haptic.c b/drivers/input/misc/max77693-haptic.c index 80f4416ffe2f..0e646f1b257b 100644 --- a/drivers/input/misc/max77693-haptic.c +++ b/drivers/input/misc/max77693-haptic.c @@ -307,7 +307,7 @@ static int max77693_haptic_probe(struct platform_device *pdev) haptic->suspend_state = false; /* Variant-specific init */ - haptic->dev_type = platform_get_device_id(pdev)->driver_data; + haptic->dev_type = max77693->type; switch (haptic->dev_type) { case TYPE_MAX77693: haptic->regmap_haptic = max77693->regmap_haptic; @@ -406,16 +406,24 @@ static DEFINE_SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops, max77693_haptic_resume); static const struct platform_device_id max77693_haptic_id[] = { - { "max77693-haptic", TYPE_MAX77693 }, - { "max77843-haptic", TYPE_MAX77843 }, + { "max77693-haptic", }, + { "max77843-haptic", }, {}, }; MODULE_DEVICE_TABLE(platform, max77693_haptic_id); +static const struct of_device_id of_max77693_haptic_dt_match[] = { + { .compatible = "maxim,max77693-haptic", }, + { .compatible = "maxim,max77843-haptic", }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, of_max77693_haptic_dt_match); + static struct platform_driver max77693_haptic_driver = { .driver = { .name = "max77693-haptic", .pm = pm_sleep_ptr(&max77693_haptic_pm_ops), + .of_match_table = of_max77693_haptic_dt_match, }, .probe = max77693_haptic_probe, .id_table = max77693_haptic_id,