From patchwork Thu Sep 26 10:39:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 11162311 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B253617EE for ; Thu, 26 Sep 2019 10:39:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90A8D222C3 for ; Thu, 26 Sep 2019 10:39:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=analog.onmicrosoft.com header.i=@analog.onmicrosoft.com header.b="gYrejJkz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725821AbfIZKji (ORCPT ); Thu, 26 Sep 2019 06:39:38 -0400 Received: from mx0b-00128a01.pphosted.com ([148.163.139.77]:40424 "EHLO mx0b-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbfIZKji (ORCPT ); Thu, 26 Sep 2019 06:39:38 -0400 Received: from pps.filterd (m0167091.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8QAc36J010420; Thu, 26 Sep 2019 06:39:09 -0400 Received: from nam05-by2-obe.outbound.protection.outlook.com (mail-by2nam05lp2057.outbound.protection.outlook.com [104.47.50.57]) by mx0b-00128a01.pphosted.com with ESMTP id 2v6hku7bfm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 26 Sep 2019 06:39:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lqBCL+Aa8iSddddbG+l9bmiBWxrGPqcP/wjiX80AB24HEEKXyIavtHZrdmtTmplsyKaqeZ9ETA4g+L27nFeAy/tsYIi9k3m5omvdpXmsL/hq7AQUoEsW6KjbiviIK2/i/3AndaH90e+TQtbOn3Mh7cqZu1NH0BCM8VO3r4RSnLOFm61529M2M+nb4V0p2dk5HPmSPR5tvx9MxyoHacwzAc2ayxbU/4FHK1soVpn7Veul40/X2O+9LwXFKz5UdSF5V07cZC/WnPDGbFl3gux0QEcaqC2WYdkbG1DitdFoJSkhfaOhb3j7PxrpxMhTw6cgkKF5DOQpH3ETFbVeG6O33w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3mpsBKRURGx6dxwNcEUXK50qwNStkQzmeYQbpyezIiE=; b=GoJsacJcKqVXPD/iE1rRApG59f6BdJiVS7STp+k3x6nStnubzXLz3+66WdMK9wlJyQNHJ6JxzSug2Dd0hsYco82Tdw6vs39JQDP6uhax04hxb3nUf93XaYsOc4bTHNSP/Y+NRdUMblBln0HXAkeuiDx2FLeb08nD/rp79Qx8p67MZfiSJok6uvxrII8NLLEx1XFr6PCABohq4H6KAarXMltgbRPpGlhi9XzwT6SgQHRbH79adt1cgJ5Vo9qLxrvfGSDTLYMSXARNcbVSJNcBFYpUxinlvUwp0sNEjjGW+VbMMwUsLMQBjC0ebrfgAaSqzXTT9IOWzDQl7CqaNYwwOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 137.71.25.55) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=analog.com; dmarc=bestguesspass action=none header.from=analog.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector2-analog-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3mpsBKRURGx6dxwNcEUXK50qwNStkQzmeYQbpyezIiE=; b=gYrejJkzcOt0a9lppPgg/KC+euoSXmq8/HSaYhOH66zbvBCpaGHu75cEmRYgbyps4w2OiF62FAhCbHo3Y9LzhbfjE12yC2KZrVQnJ/ktgMbtaR+3OEi+XaR2PwMCs4aGdc4MxeTgpmPVtjm7vqBdT1KiUO7q2fcnhFDsKM99BMM= Received: from BL0PR03CA0018.namprd03.prod.outlook.com (2603:10b6:208:2d::31) by BL0PR03MB4148.namprd03.prod.outlook.com (2603:10b6:208:65::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.20; Thu, 26 Sep 2019 10:39:07 +0000 Received: from BL2NAM02FT011.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::208) by BL0PR03CA0018.outlook.office365.com (2603:10b6:208:2d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2284.20 via Frontend Transport; Thu, 26 Sep 2019 10:39:07 +0000 Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by BL2NAM02FT011.mail.protection.outlook.com (10.152.77.5) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2284.20 via Frontend Transport; Thu, 26 Sep 2019 10:39:06 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x8QAd100026156 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Thu, 26 Sep 2019 03:39:01 -0700 Received: from nsa.sphairon.box (10.44.3.90) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 26 Sep 2019 06:39:06 -0400 From: =?utf-8?q?Nuno_S=C3=A1?= To: , , CC: Moritz Fischer , Guenter Roeck , Jean Delvare , Rob Herring , Mark Rutland Subject: [PATCH 1/3] include: fpga: adi-axi-common: Define version macros Date: Thu, 26 Sep 2019 12:39:23 +0200 Message-ID: <20190926103925.194973-2-nuno.sa@analog.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926103925.194973-1-nuno.sa@analog.com> References: <20190926103925.194973-1-nuno.sa@analog.com> MIME-Version: 1.0 X-Originating-IP: [10.44.3.90] X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(346002)(396003)(376002)(39860400002)(189003)(199004)(106002)(70206006)(1076003)(4326008)(6116002)(86362001)(36756003)(478600001)(47776003)(2906002)(2870700001)(6666004)(486006)(316002)(246002)(23676004)(50466002)(50226002)(8676002)(186003)(53416004)(26005)(5820100001)(2616005)(476003)(336012)(126002)(446003)(426003)(2201001)(11346002)(110136005)(3846002)(356004)(7736002)(8936002)(7636002)(54906003)(16526019)(305945005)(76176011)(5660300002)(45776006)(4744005)(70586007);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR03MB4148;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6838b04-d295-42c2-3d20-08d7426dc209 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600167)(711020)(4605104)(4709080)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:BL0PR03MB4148; X-MS-TrafficTypeDiagnostic: BL0PR03MB4148: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; X-Forefront-PRVS: 0172F0EF77 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: UOj6psu002vKjMBmY7TFQvDqo232MYTDIofn68eVe3iskCnlKPbK9o2mBGIVm9qP2aZ3TxQEo8b3G9yGiUqPH0yNfiGM448jnDPu+2mpwhFdWVns3S0Ajt1IqYhQZmp0aIyzkp3keUgUp4m2ntOnsq8iIobBrvZ7Sc64lpJYzQ/XBXHWyr+0gsrph0vCoJy5NoQ2/OnasfL4H/AJkYQl4S0SAglOaM1Oy1T+21Jcrs4hz9ATcWSrO42ceskDe8JwemQbbXKf1vAyj3Hz9VMaCWoCIstmXlunI0R57kP+3vONdM2a8s1pLh4Pf1UxE+Agj6EoVK/q6YM1Tum6JhdZamGgybTUznKNQUdOU3nVyqIFLpxnGGpqsRNhWPyPAM9ZIvpFhMdajdykGY3nNzJGfZWInmGVSQuyBc3cp9I0eaA= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2019 10:39:06.9967 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6838b04-d295-42c2-3d20-08d7426dc209 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR03MB4148 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-09-26_05:2019-09-25,2019-09-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 clxscore=1015 adultscore=0 spamscore=0 mlxlogscore=871 mlxscore=0 impostorscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1909260100 Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org Add commom macros to "parse" ADI HDL cores version, in terms of major, minor and patch. Signed-off-by: Nuno Sá --- include/linux/fpga/adi-axi-common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/fpga/adi-axi-common.h b/include/linux/fpga/adi-axi-common.h index 7fc95d5c95bb..5bc5603e6bc8 100644 --- a/include/linux/fpga/adi-axi-common.h +++ b/include/linux/fpga/adi-axi-common.h @@ -16,4 +16,8 @@ #define ADI_AXI_PCORE_VER(major, minor, patch) \ (((major) << 16) | ((minor) << 8) | (patch)) +#define ADI_AXI_PCORE_VER_MAJOR(version) (((version) >> 16) & 0xff) +#define ADI_AXI_PCORE_VER_MINOR(version) (((version) >> 8) & 0xff) +#define ADI_AXI_PCORE_VER_PATCH(version) ((version) & 0xff) + #endif /* ADI_AXI_COMMON_H_ */ From patchwork Thu Sep 26 10:39:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 11162313 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03A5D76 for ; Thu, 26 Sep 2019 10:39:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2B4E21D56 for ; Thu, 26 Sep 2019 10:39:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=analog.onmicrosoft.com header.i=@analog.onmicrosoft.com header.b="tbHEZ2Aa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725843AbfIZKjj (ORCPT ); Thu, 26 Sep 2019 06:39:39 -0400 Received: from mx0b-00128a01.pphosted.com ([148.163.139.77]:40308 "EHLO mx0b-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbfIZKjj (ORCPT ); Thu, 26 Sep 2019 06:39:39 -0400 Received: from pps.filterd (m0167090.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8QAcAXT026178; Thu, 26 Sep 2019 06:39:13 -0400 Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2054.outbound.protection.outlook.com [104.47.36.54]) by mx0b-00128a01.pphosted.com with ESMTP id 2v6hkcq37p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Sep 2019 06:39:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nBztQqqeolHF87xxFSdUcwoj0jc6rcx1SdVGz17RTjv0ENP8IYNDG4eHHIczq960W0VCWDgc4hMNvtvvqDmwuzuKdMA4YkWznUUGpWh5av8SkHU1h7bDFWUspCV+4YmllvWas2Yrmq81b4qsS3dtejdqxzH0PQ2gBFeAhFAJxSZa6y4S8otxyCAZ8yRqSvLA2ODXp6GKsQurUjeaMLo3uKPkQdYwHSke+D8C/fcufdqOSrL8R+ynia4A8tciKE/oCrcW/AhNTMyAzVBlNwN4qco7OyhQX9aqEALANaLIG5Hkg9kaAKNpaR1VoKsm/Rc0VsUG5li2VpM/K129GDJAng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FfZFKqroEvgSazm3NbMOoQ/m7C/VJgnARB6UMcDJtAE=; b=PbtFMxntl0UosSrWd7MH2Hems5uSoLIOvXu5QtvxVQYbvyjbjW9ePEXqvO6EPg7UYpaqGVRgxl70rXGINfay/OSA8AebUTW3MhHjB1eReyGi7LowqQVPeonyP30goOhoS8iKRNXamS8T/uNC3g4bCBR5wDOhIwAct5kv8AJQeRRfWJxM8Ig24WXemWt/bOSC3kILeQxuW+DKFAqzKitvmqnkLvfYWH5Smfn69ciI6ZKbc8pwP3cAN1NQ1dRR0jVCN/wMpS2kHUXQ6+yc+pJcPDpfWI/HaioL59pK8dt1Neau40esSMxc6mzASl+PhvtrjtavpUsPEh9++xmebu9HRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 137.71.25.55) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=analog.com; dmarc=bestguesspass action=none header.from=analog.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector2-analog-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FfZFKqroEvgSazm3NbMOoQ/m7C/VJgnARB6UMcDJtAE=; b=tbHEZ2AaoN33Cm9L6R3zSbmuJ9ExegozFR38VxPvLaXrLmqPaVxmRLSqHsqonxy/4g/NeynZjRraDB1/tkqaNRt2Tdfo2iG9RuXqWGYggB2Zm1rEKZ1E4qcOu7gORBaD9NGgYaS0lVrZexqoPKV4Fijyv/IZgdadLS/0sZY9sqE= Received: from BY5PR03CA0009.namprd03.prod.outlook.com (2603:10b6:a03:1e0::19) by DM6PR03MB4058.namprd03.prod.outlook.com (2603:10b6:5:58::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.26; Thu, 26 Sep 2019 10:39:11 +0000 Received: from BL2NAM02FT064.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::205) by BY5PR03CA0009.outlook.office365.com (2603:10b6:a03:1e0::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.15 via Frontend Transport; Thu, 26 Sep 2019 10:39:10 +0000 Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by BL2NAM02FT064.mail.protection.outlook.com (10.152.77.119) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2284.25 via Frontend Transport; Thu, 26 Sep 2019 10:39:10 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x8QAd4iQ026163 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Thu, 26 Sep 2019 03:39:04 -0700 Received: from nsa.sphairon.box (10.44.3.90) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 26 Sep 2019 06:39:08 -0400 From: =?utf-8?q?Nuno_S=C3=A1?= To: , , CC: Moritz Fischer , Guenter Roeck , Jean Delvare , Rob Herring , Mark Rutland Subject: [PATCH 2/3] hwmon: Support ADI Fan Control IP Date: Thu, 26 Sep 2019 12:39:24 +0200 Message-ID: <20190926103925.194973-3-nuno.sa@analog.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926103925.194973-1-nuno.sa@analog.com> References: <20190926103925.194973-1-nuno.sa@analog.com> MIME-Version: 1.0 X-Originating-IP: [10.44.3.90] X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(136003)(376002)(39860400002)(346002)(189003)(199004)(8936002)(50226002)(4326008)(8676002)(246002)(2201001)(45776006)(6116002)(3846002)(110136005)(106002)(50466002)(6306002)(54906003)(30864003)(14444005)(186003)(336012)(16526019)(26005)(2616005)(476003)(486006)(446003)(11346002)(316002)(5660300002)(305945005)(5820100001)(6666004)(356004)(70206006)(70586007)(53416004)(36756003)(7636002)(23676004)(7736002)(76176011)(426003)(126002)(86362001)(966005)(1076003)(2906002)(478600001)(47776003)(2870700001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR03MB4058;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1739dc3e-4010-447f-329c-08d7426dc42f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600167)(711020)(4605104)(4709080)(1401327)(4618075)(2017052603328)(7193020);SRVR:DM6PR03MB4058; X-MS-TrafficTypeDiagnostic: DM6PR03MB4058: X-MS-Exchange-PUrlCount: 1 X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-Forefront-PRVS: 0172F0EF77 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: GwPLoO5HOoxCLPMU8kGIVWbv4X1hQxekKVsnEpFSr4aJOMV9i3HYpeDtHvxeWjr0Nsg2tV5Lt7km03hbrFVzfehis+XsvQ0Q3R+Mu+lpZDssjkui/EeHoSv8a5BP97T+Sh9snUBMiG+QBmmtilX9tNb8Zp3ZjW3UGYGHosNEZkdtO30ngDVEQKZhbCSxMVWayaiHJ+R10z/EcUGGV7Y9agxXAEI3xODJtu1Wg+miJ/60Rn7VbJc5Dearlzf8kG9EkdgbTXD/u9v8e1bq4SwQsHxCBIE2wMkYxfYls9vNpgor3XoNA6ox1mtnf5f4dNYwajInATooSIpy+jX4IZt5tDbwu+mKxQj5lteGw/M2rEFzq4gTn8wl5gsjzmnCgS3TfHWAf0ZhJ5mDpxZSeA+4J/8rIk6MZoaDf9yFUCe1W+iLLcbmcpAvxqHp0/3EnugB3xw63C/0W3O8Px6OldCxGg== X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2019 10:39:10.6020 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1739dc3e-4010-447f-329c-08d7426dc42f X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4058 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-09-26_05:2019-09-25,2019-09-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 spamscore=0 malwarescore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1909260100 Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org The purpose of this IP Core is to control the fan used for the cooling of a Xilinx Zynq Ultrascale+ MPSoC without the need of any external temperature sensors. To achieve this, the IP core uses the PL SYSMONE4 primitive to obtain the PL temperature and, based on those readings, it then outputs a PWM signal to control the fan rotation accordingly. Signed-off-by: Nuno Sá --- MAINTAINERS | 7 + drivers/hwmon/Kconfig | 9 + drivers/hwmon/Makefile | 1 + drivers/hwmon/axi-fan-control.c | 452 ++++++++++++++++++++++++++++++++ 4 files changed, 469 insertions(+) create mode 100644 drivers/hwmon/axi-fan-control.c diff --git a/MAINTAINERS b/MAINTAINERS index c7035ce2460b..d775c923d23b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2853,6 +2853,13 @@ S: Maintained F: Documentation/devicetree/bindings/sound/axentia,* F: sound/soc/atmel/tse850-pcm5142.c +AXI-FAN-CONTROL HARDWARE MONITOR DRIVER +M: Nuno Sá +W: http://ez.analog.com/community/linux-device-drivers +L: linux-hwmon@vger.kernel.org +S: Supported +F: drivers/hwmon/axi-fan-control.c + AXXIA I2C CONTROLLER M: Krzysztof Adamski L: linux-i2c@vger.kernel.org diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 2ca5668bdb62..2396cc347c47 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -269,6 +269,15 @@ config SENSORS_ASC7621 This driver can also be built as a module. If so, the module will be called asc7621. +config SENSORS_AXI_FAN_CONTROL + tristate "Analog Devices FAN Control HDL Core driver" + help + If you say yes here you get support for the Analog Devices + AXI HDL FAN monitoring core. + + This driver can also be built as a module. If so, the module + will be called axi-fan-control + config SENSORS_K8TEMP tristate "AMD Athlon64/FX or Opteron temperature sensor" depends on X86 && PCI diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index c86ce4d3d36b..ebb1fd2ea82b 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -51,6 +51,7 @@ obj-$(CONFIG_SENSORS_AS370) += as370-hwmon.o obj-$(CONFIG_SENSORS_ASC7621) += asc7621.o obj-$(CONFIG_SENSORS_ASPEED) += aspeed-pwm-tacho.o obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o +obj-$(CONFIG_SENSORS_AXI_FAN_CONTROL) += axi-fan-control.o obj-$(CONFIG_SENSORS_CORETEMP) += coretemp.o obj-$(CONFIG_SENSORS_DA9052_ADC)+= da9052-hwmon.o obj-$(CONFIG_SENSORS_DA9055)+= da9055-hwmon.o diff --git a/drivers/hwmon/axi-fan-control.c b/drivers/hwmon/axi-fan-control.c new file mode 100644 index 000000000000..f86efc444753 --- /dev/null +++ b/drivers/hwmon/axi-fan-control.c @@ -0,0 +1,452 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Fan Control HDL CORE driver + * + * Copyright 2019 Analog Devices Inc. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* register map */ +#define ADI_REG_RSTN 0x0080 +#define ADI_REG_PWM_WIDTH 0x0084 +#define ADI_REG_TACH_PERIOD 0x0088 +#define ADI_REG_TACH_TOLERANCE 0x008c +#define ADI_REG_PWM_PERIOD 0x00c0 +#define ADI_REG_TACH_MEASUR 0x00c4 +#define ADI_REG_TEMPERATURE 0x00c8 + +#define ADI_REG_IRQ_MASK 0x0040 +#define ADI_REG_IRQ_PENDING 0x0044 +#define ADI_REG_IRQ_SRC 0x0048 + +/* IRQ sources */ +#define ADI_IRQ_SRC_PWM_CHANGED BIT(0) +#define ADI_IRQ_SRC_TACH_ERR BIT(1) +#define ADI_IRQ_SRC_TEMP_INCREASE BIT(2) +#define ADI_IRQ_SRC_NEW_MEASUR BIT(3) +#define ADI_IRQ_SRC_MASK GENMASK(3, 0) +#define ADI_IRQ_MASK_OUT_ALL 0xFFFFFFFFU + +#define SYSFS_PWM_MAX 255 + +struct axi_fan_control_data { + struct clk *clk; + void __iomem *base; + /* tacho period */ + atomic_t tach; + int irq; + /* pulses per revolution */ + u32 ppr; + bool hw_pwm_req; + bool update_tacho_params; + u8 fan_fault; +}; + +static inline void axi_fan_control_iowrite(const u32 val, const u32 reg, + const struct axi_fan_control_data *ctl) +{ + iowrite32(val, ctl->base + reg); +} + +static inline u32 axi_fan_control_ioread(const u32 reg, + const struct axi_fan_control_data *ctl) +{ + return ioread32(ctl->base + reg); +} + +static long axi_fan_control_get_pwm_duty(const struct axi_fan_control_data *ctl) +{ + u32 pwm_width = axi_fan_control_ioread(ADI_REG_PWM_WIDTH, ctl); + u32 pwm_period = axi_fan_control_ioread(ADI_REG_PWM_PERIOD, ctl); + + return DIV_ROUND_CLOSEST(pwm_width * SYSFS_PWM_MAX, pwm_period); +} + +static int axi_fan_control_set_pwm_duty(const long val, + struct axi_fan_control_data *ctl) +{ + u32 pwm_period = axi_fan_control_ioread(ADI_REG_PWM_PERIOD, ctl); + u32 new_width; + long __val = clamp_val(val, 0, SYSFS_PWM_MAX); + + new_width = DIV_ROUND_CLOSEST(__val * pwm_period, SYSFS_PWM_MAX); + + axi_fan_control_iowrite(new_width, ADI_REG_PWM_WIDTH, ctl); + + return 0; +} + +static long axi_fan_control_get_fan_rpm(const struct axi_fan_control_data *ctl) +{ + unsigned long clk_rate = clk_get_rate(ctl->clk); + + if (!clk_rate) + return -EINVAL; + /* + * The tacho period should be: + * TACH = 60/(ppr * rpm), where rpm is revolutions per second + * and ppr is pulses per revolution. + * Given the tacho period, we can multiply it by the input clock + * so that we know how many clocks we need to have this period. + * From this, we can derive the RPM value. + */ + return DIV_ROUND_CLOSEST(60 * clk_rate, + ctl->ppr * atomic_read(&ctl->tach)); +} + +static int axi_fan_control_read_temp(struct device *dev, u32 attr, long *val) +{ + struct axi_fan_control_data *ctl = dev_get_drvdata(dev); + long raw_temp; + + switch (attr) { + case hwmon_temp_input: + raw_temp = axi_fan_control_ioread(ADI_REG_TEMPERATURE, ctl); + /* + * The formula for the temperature is: + * T = (ADC * 501.3743 / 2^bits) - 273.6777 + * It's multiplied by 1000 to have milidegrees as + * specified by the hwmon sysfs interface. + */ + *val = ((raw_temp * 501374) >> 16) - 273677; + return 0; + default: + return -ENOTSUPP; + } +} + +static int axi_fan_control_read_fan(struct device *dev, u32 attr, long *val) +{ + struct axi_fan_control_data *ctl = dev_get_drvdata(dev); + + switch (attr) { + case hwmon_fan_fault: + *val = ctl->fan_fault; + return 0; + case hwmon_fan_input: + *val = axi_fan_control_get_fan_rpm(ctl); + return 0; + default: + return -ENOTSUPP; + } +} + +static int axi_fan_control_read_pwm(struct device *dev, u32 attr, long *val) +{ + struct axi_fan_control_data *ctl = dev_get_drvdata(dev); + + switch (attr) { + case hwmon_pwm_input: + *val = axi_fan_control_get_pwm_duty(ctl); + return 0; + default: + return -ENOTSUPP; + } +} + +static int axi_fan_control_write_pwm(struct device *dev, u32 attr, long val) +{ + struct axi_fan_control_data *ctl = dev_get_drvdata(dev); + + switch (attr) { + case hwmon_pwm_input: + return axi_fan_control_set_pwm_duty(val, ctl); + default: + return -ENOTSUPP; + } +} + +static int axi_fan_control_read_labels(struct device *dev, + enum hwmon_sensor_types type, + u32 attr, int channel, const char **str) +{ + switch (type) { + case hwmon_fan: + *str = "FAN"; + return 0; + case hwmon_temp: + *str = "SYSMON4"; + return 0; + default: + return -ENOTSUPP; + } +} + +static int axi_fan_control_read(struct device *dev, + enum hwmon_sensor_types type, + u32 attr, int channel, long *val) +{ + switch (type) { + case hwmon_fan: + return axi_fan_control_read_fan(dev, attr, val); + case hwmon_pwm: + return axi_fan_control_read_pwm(dev, attr, val); + case hwmon_temp: + return axi_fan_control_read_temp(dev, attr, val); + default: + return -ENOTSUPP; + } +} + +static int axi_fan_control_write(struct device *dev, + enum hwmon_sensor_types type, + u32 attr, int channel, long val) +{ + switch (type) { + case hwmon_pwm: + return axi_fan_control_write_pwm(dev, attr, val); + default: + return -ENOTSUPP; + } +} + +static umode_t axi_fan_control_fan_is_visible(const u32 attr) +{ + switch (attr) { + case hwmon_fan_input: + case hwmon_fan_fault: + case hwmon_fan_label: + return 0444; + default: + return 0; + } +} + +static umode_t axi_fan_control_pwm_is_visible(const u32 attr) +{ + switch (attr) { + case hwmon_pwm_input: + return 0644; + default: + return 0; + } +} + +static umode_t axi_fan_control_temp_is_visible(const u32 attr) +{ + switch (attr) { + case hwmon_temp_input: + case hwmon_temp_label: + return 0444; + default: + return 0; + } +} + +static umode_t axi_fan_control_is_visible(const void *data, + enum hwmon_sensor_types type, + u32 attr, int channel) +{ + switch (type) { + case hwmon_fan: + return axi_fan_control_fan_is_visible(attr); + case hwmon_pwm: + return axi_fan_control_pwm_is_visible(attr); + case hwmon_temp: + return axi_fan_control_temp_is_visible(attr); + default: + return 0; + } +} + +static irqreturn_t axi_fan_control_irq_handler(int irq, void *data) +{ + struct axi_fan_control_data *ctl = (struct axi_fan_control_data *)data; + u32 irq_pending = axi_fan_control_ioread(ADI_REG_IRQ_PENDING, ctl); + u32 clear_mask; + + if (irq_pending & ADI_IRQ_SRC_NEW_MEASUR) { + u32 new_tach = axi_fan_control_ioread(ADI_REG_TACH_MEASUR, + ctl); + + if (ctl->update_tacho_params) { + /* get 25% tolerance */ + u32 tach_tol = DIV_ROUND_CLOSEST(new_tach * 25, 100); + /* set new tacho parameters */ + axi_fan_control_iowrite(new_tach, ADI_REG_TACH_PERIOD, + ctl); + axi_fan_control_iowrite(tach_tol, + ADI_REG_TACH_TOLERANCE, ctl); + ctl->update_tacho_params = false; + } + + atomic_set(&ctl->tach, new_tach); + } + + if (irq_pending & ADI_IRQ_SRC_PWM_CHANGED) { + /* + * if the pwm changes on behalf of software, + * we need to provide new tacho parameters to the core. + * Wait for the next measurement for that... + */ + if (!ctl->hw_pwm_req) + ctl->update_tacho_params = true; + + /* just set this to false even if it is already... */ + ctl->hw_pwm_req = false; + } + + if (irq_pending & ADI_IRQ_SRC_TEMP_INCREASE) + /* hardware requested a new pwm */ + ctl->hw_pwm_req = true; + + if (irq_pending & ADI_IRQ_SRC_TACH_ERR) + ctl->fan_fault = 1; + + /* clear all interrupts */ + clear_mask = irq_pending & ADI_IRQ_SRC_MASK; + axi_fan_control_iowrite(clear_mask, ADI_REG_IRQ_PENDING, ctl); + + return IRQ_HANDLED; +} + +static int axi_fan_control_init(struct axi_fan_control_data *ctl, + const struct device_node *np) +{ + int ret; + + /* get fan pulses per revolution */ + ret = of_property_read_u32(np, "adi,pulses-per-revolution", &ctl->ppr); + if (ret) + return ret; + /* + * Enable all IRQs + */ + axi_fan_control_iowrite((ADI_IRQ_MASK_OUT_ALL & + ~(ADI_IRQ_SRC_NEW_MEASUR | ADI_IRQ_SRC_TACH_ERR | + ADI_IRQ_SRC_PWM_CHANGED | ADI_IRQ_SRC_TEMP_INCREASE)), + ADI_REG_IRQ_MASK, ctl); + + /* bring the device out of reset */ + axi_fan_control_iowrite(0x01, ADI_REG_RSTN, ctl); + + return ret; +} + +static const struct hwmon_channel_info *axi_fan_control_info[] = { + HWMON_CHANNEL_INFO(pwm, HWMON_PWM_INPUT), + HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT | HWMON_F_FAULT | HWMON_F_LABEL), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_LABEL), + NULL +}; + +static const struct hwmon_ops axi_fan_control_hwmon_ops = { + .is_visible = axi_fan_control_is_visible, + .read = axi_fan_control_read, + .write = axi_fan_control_write, + .read_string = axi_fan_control_read_labels, +}; + +static const struct hwmon_chip_info axi_fan_control_chip_info = { + .ops = &axi_fan_control_hwmon_ops, + .info = axi_fan_control_info, +}; + +static const u32 version_1_0_0 = ADI_AXI_PCORE_VER(1, 0, 'a'); + +static const struct of_device_id axi_fan_control_of_match[] = { + { .compatible = "adi,axi-fan-control-1.00.a", + .data = (void *)&version_1_0_0}, + {}, +}; +MODULE_DEVICE_TABLE(of, axi_fan_control_of_match); + +static int axi_fan_control_probe(struct platform_device *pdev) +{ + struct device *hwmon_dev; + struct axi_fan_control_data *ctl; + const struct of_device_id *id; + struct resource *res; + u32 version; + int ret; + + id = of_match_node(axi_fan_control_of_match, pdev->dev.of_node); + if (!id) + return -EINVAL; + + ctl = devm_kzalloc(&pdev->dev, sizeof(*ctl), GFP_KERNEL); + if (!ctl) + return -ENOMEM; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + ctl->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(ctl->base)) { + dev_err(&pdev->dev, "ioremap failed with %ld\n", + PTR_ERR(ctl->base)); + return PTR_ERR(ctl->base); + } + + ctl->clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(ctl->clk)) { + dev_err(&pdev->dev, "clk_get failed with %ld\n", + PTR_ERR(ctl->clk)); + return PTR_ERR(ctl->clk); + } + + dev_dbg(&pdev->dev, "Re-mapped from 0x%08llX to %p\n", + (unsigned long long)res->start, ctl->base); + + version = axi_fan_control_ioread(ADI_AXI_REG_VERSION, ctl); + if (ADI_AXI_PCORE_VER_MAJOR(version) != + ADI_AXI_PCORE_VER_MAJOR((*(u32 *)id->data))) { + dev_err(&pdev->dev, "Major version mismatch. Expected %d.%.2d.%c, Reported %d.%.2d.%c\n", + ADI_AXI_PCORE_VER_MAJOR((*(u32 *)id->data)), + ADI_AXI_PCORE_VER_MINOR((*(u32 *)id->data)), + ADI_AXI_PCORE_VER_PATCH((*(u32 *)id->data)), + ADI_AXI_PCORE_VER_MAJOR(version), + ADI_AXI_PCORE_VER_MINOR(version), + ADI_AXI_PCORE_VER_PATCH(version)); + return -ENODEV; + } + + ctl->irq = platform_get_irq(pdev, 0); + if (ctl->irq < 0) { + dev_err(&pdev->dev, "platform_get_irq failed with %d\n", + ctl->irq); + return ctl->irq; + } + + ret = devm_request_threaded_irq(&pdev->dev, ctl->irq, NULL, + axi_fan_control_irq_handler, + IRQF_ONESHOT | IRQF_TRIGGER_HIGH, + pdev->driver_override, ctl); + if (ret) { + dev_err(&pdev->dev, "failed to request an irq, %d", ret); + return ret; + } + + ret = axi_fan_control_init(ctl, pdev->dev.of_node); + if (ret) { + dev_err(&pdev->dev, "Failed to initialize device\n"); + return ret; + } + + hwmon_dev = devm_hwmon_device_register_with_info(&pdev->dev, + "axi_fan_control", + ctl, + &axi_fan_control_chip_info, + NULL); + + return PTR_ERR_OR_ZERO(hwmon_dev); +} + +static struct platform_driver axi_fan_control_driver = { + .driver = { + .name = "axi_fan_control_driver", + .of_match_table = axi_fan_control_of_match, + }, + .probe = axi_fan_control_probe, +}; +module_platform_driver(axi_fan_control_driver); + +MODULE_AUTHOR("Nuno Sa "); +MODULE_DESCRIPTION("Analog Devices Fan Control HDL CORE driver"); +MODULE_LICENSE("GPL"); From patchwork Thu Sep 26 10:39:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 11162319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DC4C17EE for ; Thu, 26 Sep 2019 10:39:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2BD9E2053B for ; Thu, 26 Sep 2019 10:39:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=analog.onmicrosoft.com header.i=@analog.onmicrosoft.com header.b="iH+Z/9hi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725848AbfIZKjl (ORCPT ); Thu, 26 Sep 2019 06:39:41 -0400 Received: from mx0b-00128a01.pphosted.com ([148.163.139.77]:42730 "EHLO mx0b-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbfIZKjl (ORCPT ); Thu, 26 Sep 2019 06:39:41 -0400 Received: from pps.filterd (m0167091.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8QAc36L010420; Thu, 26 Sep 2019 06:39:17 -0400 Received: from nam05-co1-obe.outbound.protection.outlook.com (mail-co1nam05lp2050.outbound.protection.outlook.com [104.47.48.50]) by mx0b-00128a01.pphosted.com with ESMTP id 2v6hku7bg7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Sep 2019 06:39:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V+ORmUnesvnumZVUHbgkfe44sk+fHz6rCI2q0IWFV92v03+eS5KzILi/J9pnvTc9bIdW9cKQ7tODxY3WrMjRKuAuBU0kX0jxzLfDQKjw+2YaFegpG+I1NUz4Gcvtmrg1l4WiS1T/uqofEKHvq13RD6e1EUzY43w1o1+JzXuazGesPgROJ9tjUT1jjC5asRGdxkZ/ObLhHZBNeRGpjeFLPX8yj26gSSkl7TZHZkpa5Q/dNjCcj1E+7UMDyHO6TNhm88BPLJWSJdsCR7IL1OeZEyEOfu/t+KXxyKJ/qn2+kQgtSLiJuVDsoWr+TSiX+St1F/4iiTI1vX+xwst0N2q6Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fDJlVEcSKRpW0HfxRhdxgOs3wBUQt0nx4MHK+w3dqgc=; b=HLFApR8Du5fbmF/CwWLmO4nkw30CxWpvlYRLByzQAlbEKkHaUpCwHtbVXd2T5gWdEppBkLd87asZWhhoV7g064zdyHz2d0s6kiAY9NGznoZfz6Nm0VJcbyEVla2rj6YlJZMy4H7Jc/qPWdCTPUnE+85wA6kRpcTS17Wb9XKQGTnOFiZPVpjcbpP9dzn8M1RA74eaMFit/+qVbOdOAxT5xIR3IEo+pAghu6nKQXQQAk5NY29tUQSjcio6Wq1qSOwGZAXJPGNGIKx6ozygPheZxD2ry3SyULWfinUT7BNXFMfxiwJj0+zzrSNkfywcOUy4HiPzdxyi1+7yB7lay5dHTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 137.71.25.55) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=analog.com; dmarc=bestguesspass action=none header.from=analog.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector2-analog-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fDJlVEcSKRpW0HfxRhdxgOs3wBUQt0nx4MHK+w3dqgc=; b=iH+Z/9hiyspezgXiwTG76V3WOEENZ52Lwis5z4xH+dM9hbvltjzJw4sXSoJGD4LAR+NsE0Xr5nMMicW006mfTcBMGQNOYeY+TkwBe/EMBnpyNq0rua9EvBNAKptiixxNsBRwhDnoUZyhxufntW25/AzVMjaOZf463uhH67G3SdA= Received: from BN3PR03CA0069.namprd03.prod.outlook.com (2a01:111:e400:7a4d::29) by MWHPR03MB2910.namprd03.prod.outlook.com (2603:10b6:300:11a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.20; Thu, 26 Sep 2019 10:39:14 +0000 Received: from BL2NAM02FT048.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by BN3PR03CA0069.outlook.office365.com (2a01:111:e400:7a4d::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.17 via Frontend Transport; Thu, 26 Sep 2019 10:39:14 +0000 Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by BL2NAM02FT048.mail.protection.outlook.com (10.152.76.109) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2284.25 via Frontend Transport; Thu, 26 Sep 2019 10:39:14 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x8QAd8In026174 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Thu, 26 Sep 2019 03:39:08 -0700 Received: from nsa.sphairon.box (10.44.3.90) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 26 Sep 2019 06:39:13 -0400 From: =?utf-8?q?Nuno_S=C3=A1?= To: , , CC: Moritz Fischer , Guenter Roeck , Jean Delvare , Rob Herring , Mark Rutland Subject: [PATCH 3/3] dt-bindings: hwmon: Add AXI FAN Control documentation Date: Thu, 26 Sep 2019 12:39:25 +0200 Message-ID: <20190926103925.194973-4-nuno.sa@analog.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926103925.194973-1-nuno.sa@analog.com> References: <20190926103925.194973-1-nuno.sa@analog.com> MIME-Version: 1.0 X-Originating-IP: [10.44.3.90] X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(376002)(39860400002)(396003)(346002)(199004)(189003)(186003)(7736002)(7636002)(106002)(54906003)(110136005)(70586007)(70206006)(966005)(36756003)(16526019)(305945005)(45776006)(8676002)(6306002)(47776003)(2906002)(1076003)(76176011)(26005)(246002)(2201001)(3846002)(6116002)(426003)(336012)(126002)(2616005)(476003)(8936002)(446003)(11346002)(53416004)(4326008)(316002)(23676004)(2870700001)(5660300002)(486006)(50466002)(356004)(478600001)(6666004)(5820100001)(50226002)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR03MB2910;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15d08355-3135-499a-1c35-08d7426dc66a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600167)(711020)(4605104)(4709080)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:MWHPR03MB2910; X-MS-TrafficTypeDiagnostic: MWHPR03MB2910: X-MS-Exchange-PUrlCount: 4 X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-Forefront-PRVS: 0172F0EF77 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: hO65fI+e7HbnY1f/t7qZtW7I/coIedaeGMsKfIczCt79FaYhYJDQKTn2Jf2kgIpCL1Nz2NWrVxIJfYizVOUz6j7i7MN7VCDHMYNTvefv10WpJbh79WF1dBLQOT9a1tlC27dJm8ipCr2zDc39QgUZTxE0cwAE84FgAz21HoVus95ESLNZqd+VLuBfTWX3NLPGjcOjea9rBuwj92RN2sZU6A7Nsj8XQyTqL2X77G/Z3ZHTt/xRSI145p30bwwScAXU2WxN+Yi5b3lhlNo/SxrloaHaMDafWUvOWaadfXssSD4vVSVuYKrQWBV5mwiQzu58koOhMe4EH6XcZqln+UL9Xo/x8H/CgBzB1SOJ2p7sBJNKATba9oyWEaEUxq4gE+4V+6+ODD7/aL3fCHSP17HjwzAEOR19T4O49lIHh1htROHgBLdP7QFHAmrajqml8QWuLmGtgHW4SGnqj8wrlX1+DQ== X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2019 10:39:14.3435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15d08355-3135-499a-1c35-08d7426dc66a X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2910 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-09-26_05:2019-09-25,2019-09-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 clxscore=1015 adultscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 impostorscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1908290000 definitions=main-1909260100 Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org Document the AXI FAN Control IP core devicetree bindings. Signed-off-by: Nuno Sá --- .../bindings/hwmon/adi,axi-fan-control.yaml | 58 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 59 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml diff --git a/Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml b/Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml new file mode 100644 index 000000000000..03948d09f600 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright 2019 Analog Devices Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bindings/hwmon/adi,axi-fan-control.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices AXI FAN Control Device Tree Bindings + +maintainers: + - Nuno Sá + +description: |+ + Bindings for the Analog Devices AXI FAN Control driver. Spefications of the + core can be found in: + + https://wiki.analog.com/resources/fpga/docs/axi_fan_control + +properties: + compatible: + enum: + - adi,axi-fan-control-1.00.a + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + interrupts: + maxItems: 1 + + adi,pulses-per-revolution: + description: Value specifying the number of pulses per revolution of the controlled FAN. + $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + - clocks + - interrupts + - adi,pulses-per-revolution + +examples: + - | + fpga_axi: fpga-axi@0 { + #address-cells = <0x2>; + #size-cells = <0x1>; + + axi_fan_control: axi-fan-control@80000000 { + compatible = "adi,axi-pulse-capture-1.00.a"; + reg = <0x0 0x80000000 0x10000>; + clocks = <&clk 71>; + interrupts = <0 110 0>; + adi,pulses-per-revolution = <2>; + }; + }; +... diff --git a/MAINTAINERS b/MAINTAINERS index d775c923d23b..ecef8dc5f0b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2859,6 +2859,7 @@ W: http://ez.analog.com/community/linux-device-drivers L: linux-hwmon@vger.kernel.org S: Supported F: drivers/hwmon/axi-fan-control.c +F: Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml AXXIA I2C CONTROLLER M: Krzysztof Adamski