Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8401691rwl; Tue, 10 Jan 2023 13:04:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXvGIUHmg97FUwpJw7yIelMB4XBLggdTpEPY8g5txd6lDu8rqAXh5xVt3XEgFKorfNLzeKeH X-Received: by 2002:a17:907:1110:b0:78d:f455:3118 with SMTP id qu16-20020a170907111000b0078df4553118mr57616241ejb.64.1673384663827; Tue, 10 Jan 2023 13:04:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673384663; cv=none; d=google.com; s=arc-20160816; b=mL1xj5uO2cEb4yECNGvHDAV6tfMN7FK1urAygcML1ER02NSG5sVRgACpbsGLAxQOTU hCRfNhMmvM5J7BkVzoFgBE80Oz93Oq6bzTgcMozwZGdKSt7XtlTkBiaR1KIyc4cbMvdG G92GJvJqSmZ+tXpSELk4+jPfptuV4738rM8jTtzxpHHdwfdKErdcpg5/sNOv8lI8YdM9 HL6eCQjU17mf9v4q+muXNcJir5jGGAZPvv7cHgeOfVLYMDmi+z3u5ADTCUu5tcTFWRpu RsUMkmM4rdGkItpLko0WL6t+HpebG2F/9MfclZIgeoa6Y/dgF6hc5wsS3387Weaw3mWA fhBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=OuOs6iuIO7Us5iOzt5B29T50jrxP7WgT+yyY8eV6uCY=; b=GDqWn630KsDsYaDTmu+UFvGoDAapKwOe58oRY77lDOE6/fSn5btM+pMxP0N22Z59Bv I2+xABw3ZaidzDip7Nj/UV8lsa3l0J/47eJLWnmi5tYH52eOYfmlToaqenUtSoCQyyBo i5Z10VtG2iF7VM2nwFk/XDX9RYnFK2KVUt7Esis0VB1AcMOrAzv8LAiLRUBMxhirdvYq tyERhotRnUI7us4DEMnWd0pHDN4MWsv/xLviy1rDaBCIbvxINyGu1KmKdMO9VWBk/krr 8RksJxaKpipbNb5Xg2ExhmBCPGyKvI/r4YAzXNTr7xc02QU5/mmRZqLY0ErFs5qSmtnS WlCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=hKB9nqYg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xh10-20020a170906da8a00b007c0c7c42636si12735971ejb.683.2023.01.10.13.04.10; Tue, 10 Jan 2023 13:04:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=hKB9nqYg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231852AbjAJUmH (ORCPT + 53 others); Tue, 10 Jan 2023 15:42:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230468AbjAJUmG (ORCPT ); Tue, 10 Jan 2023 15:42:06 -0500 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4296238AE8 for ; Tue, 10 Jan 2023 12:42:05 -0800 (PST) Received: by mail-il1-x135.google.com with SMTP id o13so6993608ilc.7 for ; Tue, 10 Jan 2023 12:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OuOs6iuIO7Us5iOzt5B29T50jrxP7WgT+yyY8eV6uCY=; b=hKB9nqYgCefZ3yWbShUJHzgCGHsyYHbuE2g3vJSKhLmIC8Dd2p+Mwk39NbfXlCAYCt FasM773iAAHDl8CJo55fNZP5dGqPTYBD8y8GHE/WA5NF895uI/f5J1By8iVhOU6DzpCS szFDdi8UGgRSul7BTsvRJOa0iT4JSz9V5yWGM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OuOs6iuIO7Us5iOzt5B29T50jrxP7WgT+yyY8eV6uCY=; b=6PI6s6wqctLA9a8bPL4CHjgE+RGRqLNcfCzM2Z3sDk1iW1wiUxr8DwuzHHfLpJFBUi K5dNsCaLzADqzp0jePB3NKA8h5IZSbQFqxb8ctk28jycHkNTHCuwyHtyeh/Pkf2JG7VF QgTrH/a5PZqbpail86t3ep0hHfjK+X8GAsN6chYi253jyx+UqY5XM8d0xd7upQycYLFH dSa0ckAHHih4iQXfvRKkeKDkzE4t8CN95o/dI5Ynpc8uQOnYRsufl7K1/9gHBKXcm0LT M5Gx1EkyjxMKCAwp7gDdinXyGKjjQK/dJMTu8UhUBCiV+IqVh6UaRyQdZlxTxxPwGM3J HXIw== X-Gm-Message-State: AFqh2koOEDI+0jNQ6hfBGPG6u+BDrP0IJ+7rBAtEKKfJoC/zy7E/TXWR HbiapgGnIh9QhpKCHdRUxsQh+UjmpEl6HFeB X-Received: by 2002:a92:c151:0:b0:303:9c30:7eff with SMTP id b17-20020a92c151000000b003039c307effmr10645991ilh.2.1673383324042; Tue, 10 Jan 2023 12:42:04 -0800 (PST) Received: from shuah-tx13.internal ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id y16-20020a920910000000b0030bfd384821sm35311ilg.81.2023.01.10.12.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 12:42:03 -0800 (PST) From: Shuah Khan To: linux-kernel@vger.kernel.org Cc: Shuah Khan Subject: [PATCH] tools:leds: add support for platform acpi led devices Date: Tue, 10 Jan 2023 13:42:01 -0700 Message-Id: <20230110204201.35482-1-skhan@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to parse platform acpi led devices. Use modalias to extract product and driver name as defined in: Documentation/ABI/testing/sysfs-bus-platform Signed-off-by: Shuah Khan --- tools/leds/get_led_device_info.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/leds/get_led_device_info.sh b/tools/leds/get_led_device_info.sh index ccfa442db5fe..a085a8ffe7c9 100755 --- a/tools/leds/get_led_device_info.sh +++ b/tools/leds/get_led_device_info.sh @@ -72,8 +72,13 @@ elif [ $of_node_missing -eq 0 ]; then manufacturer=`echo $compatible | awk -F, '{print $1}'` product=`echo $compatible | awk -F, '{print $2}'` fi +elif [ "$bus" = "platform" ]; then + cd $led_cdev_path + product=`cat device/modalias | awk -F: '{print $2}'` + driver=`cat device/modalias | awk -F: '{print $2}'` + expected_devname=`cat device/modalias | awk -F: '{print $1}'` else - echo "Unknown device type." + echo "Unknown/unsupported device type." $bus exit 1 fi @@ -112,7 +117,6 @@ printf "# LED class device name validation #\n" printf "####################################\n\n" led_name=`echo $led_cdev_path | sed s'/.*\///'` - num_sections=`echo $led_name | awk -F: '{print NF}'` if [ $num_sections -eq 1 ]; then @@ -161,6 +165,8 @@ if [ ! -z "$devicename" ]; then if [ ! -z "$expected_devname" ]; then if [ "$devicename" = "$expected_devname" ]; then print_msg_ok "$S_DEV" "$devicename" + elif [ "$bus" = "platform" ]; then + print_msg_ok "$S_DEV" "$devicename" else print_msg_failed "$S_DEV" "$devicename" "Expected: $expected_devname" fi -- 2.34.1