From: "Marvin Häuser" <Marvin.Haeuser@outlook.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "michael.d.kinney@intel.com" <michael.d.kinney@intel.com>,
"liming.gao@intel.com" <liming.gao@intel.com>
Subject: [PATCH 1/5] MdePkg/SPI: Change function definitions to match their descriptions.
Date: Tue, 27 Feb 2018 16:49:08 +0000 [thread overview]
Message-ID: <AM4PR06MB1491E08C2F444EA3B6426E0480C00@AM4PR06MB1491.eurprd06.prod.outlook.com> (raw)
The PI specification is not continuous with function headers and
descriptions for the SPI protocols. Correct and comment these
mistakes.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
MdePkg/Include/Protocol/SpiConfiguration.h | 12 ++++++++----
MdePkg/Include/Protocol/SpiHc.h | 14 +++++++++-----
MdePkg/Include/Protocol/SpiIo.h | 15 ++++++++++-----
3 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/MdePkg/Include/Protocol/SpiConfiguration.h b/MdePkg/Include/Protocol/SpiConfiguration.h
index c0df183ec7f0..c36a809f4232 100644
--- a/MdePkg/Include/Protocol/SpiConfiguration.h
+++ b/MdePkg/Include/Protocol/SpiConfiguration.h
@@ -1,7 +1,7 @@
/** @file
This file defines the SPI Configuration Protocol.
- Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License which accompanies this distribution. The full text of the license may
@@ -65,6 +65,10 @@ EFI_STATUS
IN BOOLEAN PinValue
);
+//
+// Note: In the PI specification, ClockHz is decorated as only 'IN', which is
+// not conforming to the parameter description.
+//
/**
Set up the clock generator to produce the correct clock frequency, phase and
polarity for a SPI chip.
@@ -78,7 +82,7 @@ EFI_STATUS
ClockPhase and ClockPolarity fields. The routine
also has access to the names for the SPI bus and
chip which can be used during debugging.
- @param[in] ClockHz Pointer to the requested clock frequency. The clock
+ @param[in,out] ClockHz Pointer to the requested clock frequency. The clock
generator will choose a supported clock frequency
which is less then or equal to this value.
Specify zero to turn the clock generator off.
@@ -92,8 +96,8 @@ EFI_STATUS
**/
typedef EFI_STATUS
(EFIAPI *EFI_SPI_CLOCK) (
- IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral,
- IN UINT32 *ClockHz
+ IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral,
+ IN OUT UINT32 *ClockHz
);
///
diff --git a/MdePkg/Include/Protocol/SpiHc.h b/MdePkg/Include/Protocol/SpiHc.h
index 12fe5d2dce0a..71c75431e4e8 100644
--- a/MdePkg/Include/Protocol/SpiHc.h
+++ b/MdePkg/Include/Protocol/SpiHc.h
@@ -1,7 +1,7 @@
/** @file
This file defines the SPI Host Controller Protocol.
- Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License which accompanies this distribution. The full text of the license may
@@ -66,6 +66,10 @@ typedef EFI_STATUS
IN BOOLEAN PinValue
);
+//
+// Note: In the PI specification, ClockHz is decorated as only 'IN', which is
+// not conforming to the parameter description.
+//
/**
Set up the clock generator to produce the correct clock frequency, phase and
polarity for a SPI chip.
@@ -80,7 +84,7 @@ typedef EFI_STATUS
ClockPhase and ClockPolarity fields. The routine
also has access to the names for the SPI bus and
chip which can be used during debugging.
- @param[in] ClockHz Pointer to the requested clock frequency. The SPI
+ @param[in,out] ClockHz Pointer to the requested clock frequency. The SPI
host controller will choose a supported clock
frequency which is less then or equal to this
value. Specify zero to turn the clock generator
@@ -94,9 +98,9 @@ typedef EFI_STATUS
**/
typedef EFI_STATUS
(EFIAPI *EFI_SPI_HC_PROTOCOL_CLOCK) (
- IN CONST EFI_SPI_HC_PROTOCOL *This,
- IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral,
- IN UINT32 *ClockHz
+ IN CONST EFI_SPI_HC_PROTOCOL *This,
+ IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral,
+ IN OUT UINT32 *ClockHz
);
/**
diff --git a/MdePkg/Include/Protocol/SpiIo.h b/MdePkg/Include/Protocol/SpiIo.h
index 43e804518f8b..8c5d96bb04b2 100644
--- a/MdePkg/Include/Protocol/SpiIo.h
+++ b/MdePkg/Include/Protocol/SpiIo.h
@@ -1,7 +1,7 @@
/** @file
This file defines the SPI I/O Protocol.
- Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License which accompanies this distribution. The full text of the license may
@@ -144,6 +144,11 @@ EFI_STATUS
OUT UINT8 *ReadBuffer
);
+//
+// Note: In the PI specification, 'This' is decorated with 'IN' and 'CONST'.
+// However, 'This' needs to be updated in order to reflect the
+// Peripheral update.
+//
/**
Update the SPI peripheral associated with this SPI 10 instance.
@@ -152,8 +157,8 @@ EFI_STATUS
SPI NOR flash parts, where the size and parameters change depending upon
device is in the socket.
- @param[in] This Pointer to an EFI_SPI_IO_PROTOCOL structure.
- @param[in] SpiPeripheral Pointer to an EFI_SPI_PERIPHERAL structure.
+ @param[in,out] This Pointer to an EFI_SPI_IO_PROTOCOL structure.
+ @param[in] SpiPeripheral Pointer to an EFI_SPI_PERIPHERAL structure.
@retval EFI_SUCCESS The SPI peripheral was updated successfully
@retval EFI_INVALID_PARAMETER The SpiPeripheral value is NULL,
@@ -165,8 +170,8 @@ EFI_STATUS
**/
typedef EFI_STATUS
(EFIAPI *EFI_SPI_IO_PROTOCOL_UPDATE_SPI_PERIPHERAL) (
- IN CONST EFI_SPI_IO_PROTOCOL *This,
- IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral
+ IN OUT EFI_SPI_IO_PROTOCOL *This,
+ IN CONST EFI_SPI_PERIPHERAL *SpiPeripheral
);
///
--
2.16.0.windows.2
next reply other threads:[~2018-02-27 16:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-27 16:49 Marvin Häuser [this message]
2018-03-05 2:14 ` [PATCH 1/5] MdePkg/SPI: Change function definitions to match their descriptions Bi, Dandan
2018-03-06 13:32 ` Marvin Häuser
2018-03-09 1:54 ` Bi, Dandan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AM4PR06MB1491E08C2F444EA3B6426E0480C00@AM4PR06MB1491.eurprd06.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox