Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2905185ybl; Mon, 19 Aug 2019 09:08:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJrFOp6QuJACQ/jA8tgpJcXKc4uCiyny2vXXZGpuS0sUoVtY/Tv6Tl95YiHFwuv8v7h+2B X-Received: by 2002:a17:902:6b88:: with SMTP id p8mr22499134plk.95.1566230904158; Mon, 19 Aug 2019 09:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566230904; cv=none; d=google.com; s=arc-20160816; b=o68g04hOG1fnN9fJEuREAiD2PzwaLxk2FCMpOptC+dVDnzrCgbUVMzn8X8BAXqnn89 ox695o1Dqo24m8Ylg6HUtAlHPbrrOfDNUIHBU42CNhuF87rY9Hv6ChZ2CX9Y3HV3kaFG O3nuIBJkOXE/tNstjGl8p6wpEpMR32sb5F4NliuYrkyQbcWrbgiq8NBoDIhqbw2prHG0 KpsHxWpzIh7lwQ2DGWcTAubfcctAU/Nb8qkGJBafbUykHS42lkZC2gCUqzGwLZJYCJw7 ftHRWCiRpTCVK9+ftofWee1cGTZB1n8bzD5+Lzx48pJNJZQkeronjVTUZSv8uaji88fL V6BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=zLoUlx1gsYL0OVFSMVjn2c222FNgif7/2WN9cg01ggE=; b=MI6OlsJBdbxzOgtkjXh+ouMHS+mFXaseF2+n4YIAcc8LeZUYc5u8Fm7hmXZAfYkxFr aYd5JYw24HY0KOMF+LEJsmCKuwkcPVWOOUdYfqZMpZHpe3ASV1ddZtYhv4hI37EUKQBF JJING2Zy+VcKb9xXAz9rPJzWx1agksuArblsJU3bz7MZJ0Ig1Q12jTUf/1eT0aqfSfA7 Mo7DmN2d27uoL8owhvT1fKNJsl87jKnf6mZCuXE1VcAep+M2QqXjuB/XVJ5RAIp6ahkx oe6yqLNLJZ4J/OwmWbYH9CqNydtWC64YRamleKcE1RsZxIAI8lqAGRaB3id1t1VquRqk cqyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si10008957pgv.417.2019.08.19.09.08.08; Mon, 19 Aug 2019 09:08:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727614AbfHSQHN (ORCPT + 99 others); Mon, 19 Aug 2019 12:07:13 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40985 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfHSQHN (ORCPT ); Mon, 19 Aug 2019 12:07:13 -0400 Received: by mail-wr1-f67.google.com with SMTP id j16so9284323wrr.8; Mon, 19 Aug 2019 09:07:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zLoUlx1gsYL0OVFSMVjn2c222FNgif7/2WN9cg01ggE=; b=Hdcqy3XN6hh04oX2rDHc/RLpbxvUBAZ6hOwUxNxiCq+nteTqN2fKjL3MtsKltM50TZ 59bRudQx4wUU10bsM1m4eLuKNUD89t5R0bQclwq2Y1Ai/wg9ZgAXbsKFq+yLe+1CBbVz lFhX7yORMWjfQe6pVgqfeTPrI9WmSPu1rsjXzxeAq12bgesEn44n5zq3C6f/f36rEbif l+h4HUOpqw51fTxI8QtV/7MPcxWvo/EkjjCx7Rkep/kp4V+p3sU6I3fp2KPmdlQFXk2c xI3STEKC0CgWuJNOUHZSinM8pNEXRnWaRnNc0NX63rtZGV9/YPMAdRor1dvgXZ3Tiqyy SjSw== X-Gm-Message-State: APjAAAWiJWuwMKiS8yAMeE3qn4cmnjJf4s/O7ULu5iyt7yuXP+vxlTan /x5rROy3HHTaJxE11ewIsxc= X-Received: by 2002:a5d:4250:: with SMTP id s16mr28682362wrr.318.1566230830772; Mon, 19 Aug 2019 09:07:10 -0700 (PDT) Received: from green.intra.ispras.ru (bran.ispras.ru. [83.149.199.196]) by smtp.googlemail.com with ESMTPSA id b136sm32442189wme.18.2019.08.19.09.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 09:07:09 -0700 (PDT) From: Denis Efremov To: Bjorn Helgaas Cc: Denis Efremov , Lukas Wunner , sathyanarayanan kuppuswamy , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/4] Simplify PCIe hotplug indicator control Date: Mon, 19 Aug 2019 19:06:39 +0300 Message-Id: <20190819160643.27998-1-efremov@linux.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PCIe defines two optional hotplug indicators: a Power indicator and an Attention indicator. Both are controlled by the same register, and each can be on, off or blinking. The current interfaces (pciehp_green_led_{on,off,blink}() and pciehp_set_attention_status()) are non-uniform and require two register writes in many cases where we could do one. This patchset introduces the new function pciehp_set_indicators(). It allows one to set two indicators with a single register write. All calls to previous interfaces (pciehp_green_led_* and pciehp_set_attention_status()) are replaced with a new one. Thus, the amount of duplicated code for setting indicators is reduced. Changes in v3: - Changed pciehp_set_indicators() to work with existing PCI_EXP_SLTCTL_* macros - Reworked the inputs validation in pciehp_set_indicators() - Removed pciehp_set_attention_status() and pciehp_green_led_*() completely Denis Efremov (4): PCI: pciehp: Add pciehp_set_indicators() to jointly set LED indicators PCI: pciehp: Switch LED indicators with a single write PCI: pciehp: Remove pciehp_set_attention_status() PCI: pciehp: Remove pciehp_green_led_{on,off,blink}() drivers/pci/hotplug/pciehp.h | 5 +- drivers/pci/hotplug/pciehp_core.c | 7 ++- drivers/pci/hotplug/pciehp_ctrl.c | 31 +++++++----- drivers/pci/hotplug/pciehp_hpc.c | 82 ++++++++++--------------------- include/uapi/linux/pci_regs.h | 3 ++ 5 files changed, 54 insertions(+), 74 deletions(-) -- 2.21.0