From patchwork Wed Apr 19 21:07:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 8449 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp667290vqo; Wed, 19 Apr 2023 14:10:59 -0700 (PDT) X-Google-Smtp-Source: AKy350Z4V+OVS/mFeMVckVFNbZNxeR9xX1IFFFu5xQ4PUxxAMUuCJtE02iJZjPBMCSES0DD05Wrz X-Received: by 2002:a17:90a:3c89:b0:247:e5f:ca9 with SMTP id g9-20020a17090a3c8900b002470e5f0ca9mr4337297pjc.4.1681938659394; Wed, 19 Apr 2023 14:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681938659; cv=none; d=google.com; s=arc-20160816; b=WqIfH3egpVg92DksvA8yDFS7AFNq8WmomE8Zu9jVes95zaFMl0R7ppYTIebGSvWFEE xQFgXBKXS02qORGuVhtPDYyaUzu/06j+mjPU3mfDSAwGcy34wpYISNrQR+kNTkAyJAOp hugaLGaSdaUFZCdITPx6v43yjAK788DYwODh7e+HrRhuGZGQljEry2Ktg/LXIpIy2uV/ RYXnCoLfmFWJe2H0cBzB6BhyQAznU8UvwZ9S0F7CbC1iatBFfYX4yLCjtuwHzyGk3Nda G84QcdT6Z5NjRZEUwp/wW717uXO/tiZ3elraehllLroHKbL3AjFmqXltFISUERzw1oe3 Mz5w== 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:to:from:dkim-signature; bh=9hKavX6galpUw3m8pjNHJAGofqqTil5bnA94vuO7DqA=; b=YruIDbcKsNTglniEUpqe275JTykxGwR5z9NrCaPwk0QBzkHhW9BJ9ywQwRL+/dG+UC aZkkiXI5CxoT9PiAHfUWcvvCOAJaM4lO9K+D35BqpYkZXWAKRyBOLHTghfaFRouSTzIt DvDK3NxnzzZRaUTfmByMwO4drKHMhr2d2HeN3m9sEhNxUSsuWfuyNM3gaBj8/i7xb9vd gTbgoVgC9cjExbXilwB0XWzphbg+ix/m+QdXONoZ8K4NICbnX3pgVwuJY9RQfBUohTJN s+VPqSIE3TP3Abnv8jykCPXh0ieAK7BtqfnEOORUDaZlBsGYOib45BZQS6iZV30bfGKv Ewtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=NDFyOEJP; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 65-20020a630844000000b0051322a6bf76si16691113pgi.77.2023.04.19.14.10.44; Wed, 19 Apr 2023 14:10:59 -0700 (PDT) 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=@gmail.com header.s=20221208 header.b=NDFyOEJP; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231334AbjDSVIU (ORCPT + 99 others); Wed, 19 Apr 2023 17:08:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230254AbjDSVIS (ORCPT ); Wed, 19 Apr 2023 17:08:18 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E11961BE; Wed, 19 Apr 2023 14:08:16 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id v20-20020a05600c471400b003ed8826253aso2769649wmo.0; Wed, 19 Apr 2023 14:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681938494; x=1684530494; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=9hKavX6galpUw3m8pjNHJAGofqqTil5bnA94vuO7DqA=; b=NDFyOEJPl/51+YYFqyOkBgZKjTCR3wPUDyaVN/Ru9RzFucqvwRc9HKxNXsP/EIYZfI fQqnUeiuJ15yHuNghA0OllKU33BbPqV5po5S+8/xKLi0RbO6gzV/AysijkCFpxPuwnsQ sY17N9n4TV3vfFYGwNYEuVGkSBrxHNaeXbTsstSYfaj6TXksmb++rw7+jT2IhPE796bF fWGesTnLTsM6lPTyMO23+TJKzqJ/Wrm0igYDfjV7X6uB5eDoREDQ3Div50JkusM7uStS h1iq5DCKlVo5PEbDWyBGHuJRst78vvk0rvDfW7dBIOIfRUS5R3xYmXbKDb6mKc1qVsuM 0zqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681938494; x=1684530494; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9hKavX6galpUw3m8pjNHJAGofqqTil5bnA94vuO7DqA=; b=Jh6TjEzDPwEfg6BpBzIkFxvgVsekzJsWnZigk1ipncVFkQZk7G/gUJingOq3621EO5 9TP/tRPjzuy/XjQPaRK5ElOcRVeuEGMEV6Zwo8aw5IblbwDtlMBAjxk1ocRwAtGCpDXQ /ySpFI0agEHipr4gHos1ZFHUHeE4Jl8ds6hnUunsTxFqitLY09MqIcMxAXQvWLY+If94 7ZPHQP5WeUg96Jcshc9ubZZ/lCqFCoKIDrri8vyNlkaBJd1dcq/lgYc8Hw+/Ezx02LI8 iZ/q0X0E0q4DSFvysB9zqqiCrg1sPEpVSmu9/qPZVNzgV6uKSynoEjkuSilbJeY1L62I dXqg== X-Gm-Message-State: AAQBX9dlXveHZgxvUEnwQFq3+iSS4Xbi5YifvQCPtQQ0v9hzGa22OB5b bjuD/0yjw777Uj0QVcz7U6A= X-Received: by 2002:a1c:7207:0:b0:3f1:72fb:461a with SMTP id n7-20020a1c7207000000b003f172fb461amr10046696wmc.2.1681938494445; Wed, 19 Apr 2023 14:08:14 -0700 (PDT) Received: from localhost.localdomain (93-34-93-173.ip49.fastwebnet.it. [93.34.93.173]) by smtp.googlemail.com with ESMTPSA id g3-20020a5d5543000000b002fe254f6c33sm81295wrw.92.2023.04.19.14.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 14:08:14 -0700 (PDT) From: Christian Marangi To: Pavel Machek , Lee Jones , Christian Marangi , Martin Schiller , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn Subject: [PATCH 0/5] leds: trigger: netdev: fixup preparation for LEDs hw control Date: Wed, 19 Apr 2023 23:07:38 +0200 Message-Id: <20230419210743.3594-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763640511712047627?= X-GMAIL-MSGID: =?utf-8?q?1763640511712047627?= This is a continue of [1]. It was decided to take a more gradual approach to implement LEDs support for switch and phy starting with basic support and then implementing the hw control part when we have all the prereq done. This is a small series in preparation for a bigger change adding support for LEDs hw control. Some minor fixup and improvements are required to add support for LEDs hw control for the netdev trigger. The main fixes are switching to mutex from spinlocks and adding namespace to netdev trigger enum modes. These will be exposed in the future in the generic linux include folder so LEDs driver may supports these specific modes. While working on htis it was also discovered a bug addressed in the first patch of this series. Changes from the old v8 series: - Reword some commits and add more info on why the changes is needed - Add fixup patch on dev rename Christian Marangi (5): leds: trigger: netdev: recheck NETDEV_LED_MODE_LINKUP on dev rename leds: trigger: netdev: drop NETDEV_LED_MODE_LINKUP from mode leds: trigger: netdev: rename add namespace to netdev trigger enum modes leds: trigger: netdev: convert device attr to macro leds: trigger: netdev: use mutex instead of spinlocks drivers/leds/trigger/ledtrig-netdev.c | 151 ++++++++++---------------- 1 file changed, 59 insertions(+), 92 deletions(-)