Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v3 07/10] arm64: dts: marvell: mcbin: add 10G SFP support
From: Antoine Tenart @ 2018-05-17  8:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180517082939.14598-1-antoine.tenart@bootlin.com>

From: Russell King <rmk+kernel@armlinux.org.uk>

This patch adds the SFP cage description in the Marvell Armada 8040
mcbin, for both 10G interfaces.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
[Antoine: small reworks, commit message]
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 .../boot/dts/marvell/armada-8040-mcbin.dts    | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
index 81de03ef860d..eaa67de8c2bb 100644
--- a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
+++ b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
@@ -64,6 +64,30 @@
 		compatible = "usb-nop-xceiv";
 		vcc-supply = <&v_5v0_usb3_hst_vbus>;
 	};
+
+	sfp_eth0: sfp-eth0 {
+		/* CON15,16 - CPM lane 4 */
+		compatible = "sff,sfp";
+		i2c-bus = <&sfpp0_i2c>;
+		los-gpio = <&cp1_gpio1 28 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&cp1_gpio1 27 GPIO_ACTIVE_LOW>;
+		tx-disable-gpio = <&cp1_gpio1 29 GPIO_ACTIVE_HIGH>;
+		tx-fault-gpio  = <&cp1_gpio1 26 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&cp1_sfpp0_pins>;
+	};
+
+	sfp_eth1: sfp-eth1 {
+		/* CON17,18 - CPS lane 4 */
+		compatible = "sff,sfp";
+		i2c-bus = <&sfpp1_i2c>;
+		los-gpio = <&cp1_gpio1 8 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&cp1_gpio1 11 GPIO_ACTIVE_LOW>;
+		tx-disable-gpio = <&cp1_gpio1 10 GPIO_ACTIVE_HIGH>;
+		tx-fault-gpio = <&cp0_gpio2 30 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&cp1_sfpp1_pins &cp0_sfpp1_pins>;
+	};
 };
 
 &uart0 {
@@ -180,6 +204,10 @@
 			       "mpp60", "mpp61";
 		marvell,function = "sdio";
 	};
+	cp0_sfpp1_pins: sfpp1-pins {
+		marvell,pins = "mpp62";
+		marvell,function = "gpio";
+	};
 };
 
 &cp0_xmdio {
@@ -188,11 +216,13 @@
 	phy0: ethernet-phy at 0 {
 		compatible = "ethernet-phy-ieee802.3-c45";
 		reg = <0>;
+		sfp = <&sfp_eth0>;
 	};
 
 	phy8: ethernet-phy at 8 {
 		compatible = "ethernet-phy-ieee802.3-c45";
 		reg = <8>;
+		sfp = <&sfp_eth1>;
 	};
 };
 
@@ -258,6 +288,10 @@
 };
 
 &cp1_pinctrl {
+	cp1_sfpp1_pins: sfpp1-pins {
+		marvell,pins = "mpp8", "mpp10", "mpp11";
+		marvell,function = "gpio";
+	};
 	cp1_spi1_pins: spi1-pins {
 		marvell,pins = "mpp12", "mpp13", "mpp14", "mpp15", "mpp16";
 		marvell,function = "spi1";
@@ -266,6 +300,10 @@
 		marvell,pins = "mpp6", "mpp7";
 		marvell,function = "uart0";
 	};
+	cp1_sfpp0_pins: sfpp0-pins {
+		marvell,pins = "mpp26", "mpp27", "mpp28", "mpp29";
+		marvell,function = "gpio";
+	};
 };
 
 /* J27 UART header */
-- 
2.17.0

^ permalink raw reply related

* [PATCH net-next v3 08/10] arm64: dts: marvell: mcbin: enable the fourth network interface
From: Antoine Tenart @ 2018-05-17  8:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180517082939.14598-1-antoine.tenart@bootlin.com>

This patch enables the fourth network interface on the Marvell
Macchiatobin. It is configured in the 2500Base-X PHY mode. The SFP cage
is also described.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 .../boot/dts/marvell/armada-8040-mcbin.dts    | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
index eaa67de8c2bb..a66958ff4de6 100644
--- a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
+++ b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
@@ -27,6 +27,7 @@
 		ethernet0 = &cp0_eth0;
 		ethernet1 = &cp1_eth0;
 		ethernet2 = &cp1_eth1;
+		ethernet3 = &cp1_eth2;
 	};
 
 	/* Regulator labels correspond with schematics */
@@ -88,6 +89,18 @@
 		pinctrl-names = "default";
 		pinctrl-0 = <&cp1_sfpp1_pins &cp0_sfpp1_pins>;
 	};
+
+	sfp_eth3: sfp-eth3 {
+		/* CON3,4 - CPS lane 5 */
+		compatible = "sff,sfp";
+		i2c-bus = <&sfp_1g_i2c>;
+		los-gpio = <&cp0_gpio2 22 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&cp0_gpio2 21 GPIO_ACTIVE_LOW>;
+		tx-disable-gpio = <&cp1_gpio1 24 GPIO_ACTIVE_HIGH>;
+		tx-fault-gpio = <&cp0_gpio2 19 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&cp0_sfp_1g_pins &cp1_sfp_1g_pins>;
+	};
 };
 
 &uart0 {
@@ -195,6 +208,10 @@
 		marvell,pins = "mpp47";
 		marvell,function = "gpio";
 	};
+	cp0_sfp_1g_pins: sfp-1g-pins {
+		marvell,pins = "mpp51", "mpp53", "mpp54";
+		marvell,function = "gpio";
+	};
 	cp0_pcie_pins: pcie-pins {
 		marvell,pins = "mpp52";
 		marvell,function = "gpio";
@@ -287,6 +304,17 @@
 	phys = <&cp1_comphy0 1>;
 };
 
+&cp1_eth2 {
+	/* CPS Lane 5 */
+	status = "okay";
+	/* Network PHY */
+	phy-mode = "2500base-x";
+	managed = "in-band-status";
+	/* Generic PHY, providing serdes lanes */
+	phys = <&cp1_comphy5 2>;
+	sfp = <&sfp_eth3>;
+};
+
 &cp1_pinctrl {
 	cp1_sfpp1_pins: sfpp1-pins {
 		marvell,pins = "mpp8", "mpp10", "mpp11";
@@ -300,6 +328,10 @@
 		marvell,pins = "mpp6", "mpp7";
 		marvell,function = "uart0";
 	};
+	cp1_sfp_1g_pins: sfp-1g-pins {
+		marvell,pins = "mpp24";
+		marvell,function = "gpio";
+	};
 	cp1_sfpp0_pins: sfpp0-pins {
 		marvell,pins = "mpp26", "mpp27", "mpp28", "mpp29";
 		marvell,function = "gpio";
-- 
2.17.0

^ permalink raw reply related

* [PATCH net-next v3 09/10] arm64: dts: marvell: 8040-db: describe the 10G interfaces as fixed-link
From: Antoine Tenart @ 2018-05-17  8:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180517082939.14598-1-antoine.tenart@bootlin.com>

This patch adds a fixed-link node to both 10G interfaces of the 8040-db
board. This is required as the mvpp2 driver now uses phylink. The best
solution would have been to describe the SFP cages but they are not
wired correctly, and thus unusable, so we chose to use fixed-link
instead.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 arch/arm64/boot/dts/marvell/armada-8040-db.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/armada-8040-db.dts b/arch/arm64/boot/dts/marvell/armada-8040-db.dts
index 5689fb23bbab..1bac437369a1 100644
--- a/arch/arm64/boot/dts/marvell/armada-8040-db.dts
+++ b/arch/arm64/boot/dts/marvell/armada-8040-db.dts
@@ -177,6 +177,11 @@
 &cp0_eth0 {
 	status = "okay";
 	phy-mode = "10gbase-kr";
+
+	fixed-link {
+		speed = <10000>;
+		full-duplex;
+	};
 };
 
 &cp0_eth2 {
@@ -303,6 +308,11 @@
 &cp1_eth0 {
 	status = "okay";
 	phy-mode = "10gbase-kr";
+
+	fixed-link {
+		speed = <10000>;
+		full-duplex;
+	};
 };
 
 &cp1_eth1 {
-- 
2.17.0

^ permalink raw reply related

* [PATCH net-next v3 10/10] arm64: dts: marvell: 7040-db: describe the 10G interface as fixed-link
From: Antoine Tenart @ 2018-05-17  8:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180517082939.14598-1-antoine.tenart@bootlin.com>

This patch adds a fixed-link node to the 10G interface of the 7040-db
board. This is required as the mvpp2 driver now uses phylink. The best
solution would have been to describe the SFP cage but they are not
wired correctly, and thus unusable, so we chose to use fixed-link
instead.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 arch/arm64/boot/dts/marvell/armada-7040-db.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/armada-7040-db.dts b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
index d6bec058a30a..412efdb46e7c 100644
--- a/arch/arm64/boot/dts/marvell/armada-7040-db.dts
+++ b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
@@ -242,6 +242,11 @@
 	phy-mode = "10gbase-kr";
 	/* Generic PHY, providing serdes lanes */
 	phys = <&cp0_comphy2 0>;
+
+	fixed-link {
+		speed = <10000>;
+		full-duplex;
+	};
 };
 
 &cp0_eth1 {
-- 
2.17.0

^ permalink raw reply related

* [PATCH 2/8] firmware: arm_scmi: fix kernel-docs documentation
From: Jonathan Cameron @ 2018-05-17  8:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1525885634-22348-3-git-send-email-sudeep.holla@arm.com>

On Wed, 9 May 2018 18:07:08 +0100
Sudeep Holla <sudeep.holla@arm.com> wrote:

> There are few missing descriptions for function parameters and structure
> members along with certain instances where excessive function parameters
> or structure members are described.
> 
> This patch fixes all of those warnings.
> 
> Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

A few really minor points inline.   The white space changes should
be in a separate patch. It's not a big thing in a simple patch
like this one, but it is good practice in general.

With the white space changes pulled out of here.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Thanks,

Jonathan

> ---
>  drivers/firmware/arm_scmi/base.c   | 20 +++++++++--------
>  drivers/firmware/arm_scmi/common.h |  7 ++++--
>  drivers/firmware/arm_scmi/driver.c | 45 ++++++++++++++++++++------------------
>  include/linux/scmi_protocol.h      |  8 +++++++
>  4 files changed, 48 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/base.c b/drivers/firmware/arm_scmi/base.c
> index 0d3806c0d432..c36ded9dbb83 100644
> --- a/drivers/firmware/arm_scmi/base.c
> +++ b/drivers/firmware/arm_scmi/base.c
> @@ -26,7 +26,7 @@ struct scmi_msg_resp_base_attributes {
>   * scmi_base_attributes_get() - gets the implementation details
>   *	that are associated with the base protocol.
>   *
> - * @handle - SCMI entity handle
> + * @handle: SCMI entity handle
>   *
>   * Return: 0 on success, else appropriate SCMI error.
>   */
> @@ -50,14 +50,15 @@ static int scmi_base_attributes_get(const struct scmi_handle *handle)
>  	}
>  
>  	scmi_one_xfer_put(handle, t);
> +

Unrelated change, please have these white space improvements in
a separate patch.

>  	return ret;
>  }
>  
>  /**
>   * scmi_base_vendor_id_get() - gets vendor/subvendor identifier ASCII string.
>   *
> - * @handle - SCMI entity handle
> - * @sub_vendor - specify true if sub-vendor ID is needed
> + * @handle: SCMI entity handle
> + * @sub_vendor: specify true if sub-vendor ID is needed
>   *
>   * Return: 0 on success, else appropriate SCMI error.
>   */
> @@ -97,7 +98,7 @@ scmi_base_vendor_id_get(const struct scmi_handle *handle, bool sub_vendor)
>   *	implementation 32-bit version. The format of the version number is
>   *	vendor-specific
>   *
> - * @handle - SCMI entity handle
> + * @handle: SCMI entity handle
>   *
>   * Return: 0 on success, else appropriate SCMI error.
>   */
> @@ -128,8 +129,8 @@ scmi_base_implementation_version_get(const struct scmi_handle *handle)
>   * scmi_base_implementation_list_get() - gets the list of protocols it is
>   *	OSPM is allowed to access
>   *
> - * @handle - SCMI entity handle
> - * @protocols_imp - pointer to hold the list of protocol identifiers
> + * @handle: SCMI entity handle
> + * @protocols_imp: pointer to hold the list of protocol identifiers
>   *
>   * Return: 0 on success, else appropriate SCMI error.
>   */
> @@ -173,15 +174,16 @@ static int scmi_base_implementation_list_get(const struct scmi_handle *handle,
>  	} while (loop_num_ret);
>  
>  	scmi_one_xfer_put(handle, t);
> +

Another unrelated change.

>  	return ret;
>  }
>  
>  /**
>   * scmi_base_discover_agent_get() - discover the name of an agent
>   *
> - * @handle - SCMI entity handle
> - * @id - Agent identifier
> - * @name - Agent identifier ASCII string
> + * @handle: SCMI entity handle
> + * @id: Agent identifier
> + * @name: Agent identifier ASCII string
>   *
>   * An agent id of 0 is reserved to identify the platform itself.
>   * Generally operating system is represented as "OSPM"
> diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
> index e8f332c9c469..0821662a4633 100644
> --- a/drivers/firmware/arm_scmi/common.h
> +++ b/drivers/firmware/arm_scmi/common.h
> @@ -51,8 +51,11 @@ struct scmi_msg_resp_prot_version {
>   * @id: The identifier of the command being sent
>   * @protocol_id: The identifier of the protocol used to send @id command
>   * @seq: The token to identify the message. when a message/command returns,
> - *       the platform returns the whole message header unmodified including
> - *	 the token.
> + *	the platform returns the whole message header unmodified including
> + *	the token
> + * @status: Status of the transfer once it's complete
> + * @poll_completion: Indicate if the transfer needs to be polled for
> + *	completion or interrupt mode is used
>   */
>  struct scmi_msg_hdr {
>  	u8 id;
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 917786d91f55..6fee11f06a66 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -51,7 +51,7 @@ enum scmi_error_codes {
>  	SCMI_ERR_MAX
>  };
>  
> -/* List of all  SCMI devices active in system */
> +/* List of all SCMI devices active in system */
>  static LIST_HEAD(scmi_list);
>  /* Protection for the entire list */
>  static DEFINE_MUTEX(scmi_list_mutex);
> @@ -68,7 +68,6 @@ static DEFINE_MUTEX(scmi_list_mutex);
>  struct scmi_xfers_info {
>  	struct scmi_xfer *xfer_block;
>  	unsigned long *xfer_alloc_table;
> -	/* protect transfer allocation */
>  	spinlock_t xfer_lock;
>  };
>  
> @@ -94,6 +93,7 @@ struct scmi_desc {
>   * @payload: Transmit/Receive mailbox channel payload area
>   * @dev: Reference to device in the SCMI hierarchy corresponding to this
>   *	 channel
> + * @handle: Pointer to SCMI entity handle
>   */
>  struct scmi_chan_info {
>  	struct mbox_client cl;
> @@ -104,7 +104,7 @@ struct scmi_chan_info {
>  };
>  
>  /**
> - * struct scmi_info - Structure representing a  SCMI instance
> + * struct scmi_info - Structure representing a SCMI instance

Nitpick: an SCMI

>   *
>   * @dev: Device pointer
>   * @desc: SoC description for this instance
> @@ -113,9 +113,9 @@ struct scmi_chan_info {
>   *	implementation version and (sub-)vendor identification.
>   * @minfo: Message info
>   * @tx_idr: IDR object to map protocol id to channel info pointer
> - * @protocols_imp: list of protocols implemented, currently maximum of
> + * @protocols_imp: List of protocols implemented, currently maximum of
>   *	MAX_PROTOCOLS_IMP elements allocated by the base protocol
> - * @node: list head
> + * @node: List head
>   * @users: Number of users of this instance
>   */
>  struct scmi_info {
> @@ -221,9 +221,7 @@ static void scmi_rx_callback(struct mbox_client *cl, void *m)
>  
>  	xfer_id = MSG_XTRACT_TOKEN(ioread32(&mem->msg_header));
>  
> -	/*
> -	 * Are we even expecting this?
> -	 */
> +	/* Are we even expecting this? */

Technically this is a different issue, but as it's comment related
you 'could' put it in the same patch if the description mentions it.

>  	if (!test_bit(xfer_id, minfo->xfer_alloc_table)) {
>  		dev_err(dev, "message for %d is not expected!\n", xfer_id);
>  		return;
> @@ -248,6 +246,8 @@ static void scmi_rx_callback(struct mbox_client *cl, void *m)
>   *
>   * @hdr: pointer to header containing all the information on message id,
>   *	protocol id and sequence id.
> + *
> + * Return: 32-bit packed command header to be sent to the platform.
>   */
>  static inline u32 pack_scmi_header(struct scmi_msg_hdr *hdr)
>  {
> @@ -282,9 +282,9 @@ static void scmi_tx_prepare(struct mbox_client *cl, void *m)
>  }
>  
>  /**
> - * scmi_one_xfer_get() - Allocate one message
> + * scmi_xfer_get() - Allocate one message
>   *
> - * @handle: SCMI entity handle
> + * @handle: Pointer to SCMI entity handle
>   *
>   * Helper function which is used by various command functions that are
>   * exposed to clients of this driver for allocating a message traffic event.
> @@ -326,8 +326,8 @@ static struct scmi_xfer *scmi_one_xfer_get(const struct scmi_handle *handle)
>  /**
>   * scmi_one_xfer_put() - Release a message
>   *
> - * @minfo: transfer info pointer
> - * @xfer: message that was reserved by scmi_one_xfer_get
> + * @handle: Pointer to SCMI entity handle
> + * @xfer: message that was reserved by scmi_xfer_get
>   *
>   * This holds a spinlock to maintain integrity of internal data structures.
>   */
> @@ -374,12 +374,12 @@ static bool scmi_xfer_done_no_timeout(const struct scmi_chan_info *cinfo,
>  /**
>   * scmi_do_xfer() - Do one transfer
>   *
> - * @info: Pointer to SCMI entity information
> + * @handle: Pointer to SCMI entity handle
>   * @xfer: Transfer to initiate and wait for response
>   *
>   * Return: -ETIMEDOUT in case of no response, if transmit error,
> - *   return corresponding error, else if all goes well,
> - *   return 0.
> + *	return corresponding error, else if all goes well,
> + *	return 0.
>   */
>  int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer)
>  {
> @@ -438,9 +438,9 @@ int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer)
>  /**
>   * scmi_one_xfer_init() - Allocate and initialise one message
>   *
> - * @handle: SCMI entity handle
> + * @handle: Pointer to SCMI entity handle
>   * @msg_id: Message identifier
> - * @msg_prot_id: Protocol identifier for the message
> + * @prot_id: Protocol identifier for the message
>   * @tx_size: transmit message size
>   * @rx_size: receive message size
>   * @p: pointer to the allocated and initialised message
> @@ -478,13 +478,16 @@ int scmi_one_xfer_init(const struct scmi_handle *handle, u8 msg_id, u8 prot_id,
>  	xfer->hdr.poll_completion = false;
>  
>  	*p = xfer;
> +

Same comment.

>  	return 0;
>  }
>  
>  /**
>   * scmi_version_get() - command to get the revision of the SCMI entity
>   *
> - * @handle: Handle to SCMI entity information
> + * @handle: Pointer to SCMI entity handle
> + * @protocol: Protocol identifier for the message
> + * @version: Holds returned version of protocol.
>   *
>   * Updates the SCMI information in the internal data structure.
>   *
> @@ -541,7 +544,7 @@ scmi_is_protocol_implemented(const struct scmi_handle *handle, u8 prot_id)
>   * @dev: pointer to device for which we want SCMI handle
>   *
>   * NOTE: The function does not track individual clients of the framework
> - * and is expected to be maintained by caller of  SCMI protocol library.
> + * and is expected to be maintained by caller of SCMI protocol library.
>   * scmi_handle_put must be balanced with successful scmi_handle_get
>   *
>   * Return: pointer to handle if successful, NULL on error
> @@ -572,7 +575,7 @@ struct scmi_handle *scmi_handle_get(struct device *dev)
>   * @handle: handle acquired by scmi_handle_get
>   *
>   * NOTE: The function does not track individual clients of the framework
> - * and is expected to be maintained by caller of  SCMI protocol library.
> + * and is expected to be maintained by caller of SCMI protocol library.
>   * scmi_handle_put must be balanced with successful scmi_handle_get
>   *
>   * Return: 0 is successfully released
> @@ -595,7 +598,7 @@ int scmi_handle_put(const struct scmi_handle *handle)
>  }
>  
>  static const struct scmi_desc scmi_generic_desc = {
> -	.max_rx_timeout_ms = 30,	/* we may increase this if required */
> +	.max_rx_timeout_ms = 30,	/* We may increase this if required */
>  	.max_msg = 20,		/* Limited by MBOX_TX_QUEUE_LEN */
>  	.max_msg_size = 128,
>  };
> diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
> index b458c87b866c..a171c1e293e8 100644
> --- a/include/linux/scmi_protocol.h
> +++ b/include/linux/scmi_protocol.h
> @@ -189,6 +189,14 @@ struct scmi_sensor_ops {
>   * @perf_ops: pointer to set of performance protocol operations
>   * @clk_ops: pointer to set of clock protocol operations
>   * @sensor_ops: pointer to set of sensor protocol operations
> + * @perf_priv: pointer to private data structure specific to performance
> + *	protocol(for internal use only)
> + * @clk_priv: pointer to private data structure specific to clock
> + *	protocol(for internal use only)
> + * @power_priv: pointer to private data structure specific to power
> + *	protocol(for internal use only)
> + * @sensor_priv: pointer to private data structure specific to sensors
> + *	protocol(for internal use only)
>   */
>  struct scmi_handle {
>  	struct device *dev;

^ permalink raw reply

* [PATCH 3/8] firmware: arm_scmi: rename get_transition_latency and add_opps_to_device
From: Jonathan Cameron @ 2018-05-17  8:32 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1525885634-22348-4-git-send-email-sudeep.holla@arm.com>

On Wed, 9 May 2018 18:07:09 +0100
Sudeep Holla <sudeep.holla@arm.com> wrote:

> Most of the scmi code follows the suggestion from Greg KH on a totally
> different thread[0] to have the subsystem name first, followed by the
> noun and finally the verb with couple of these exceptions.
> 
> This patch fixes them so that all the functions names are aligned to
> on practice.
> 
> [0] https://www.spinics.net/lists/arm-kernel/msg583673.html
> 
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Sensible tidy up, for what it's worth

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/cpufreq/scmi-cpufreq.c   |  4 ++--
>  drivers/firmware/arm_scmi/perf.c | 10 +++++-----
>  include/linux/scmi_protocol.h    | 10 +++++-----
>  3 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
> index b4dbc77459b6..50b1551ba894 100644
> --- a/drivers/cpufreq/scmi-cpufreq.c
> +++ b/drivers/cpufreq/scmi-cpufreq.c
> @@ -117,7 +117,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
>  		return -ENODEV;
>  	}
>  
> -	ret = handle->perf_ops->add_opps_to_device(handle, cpu_dev);
> +	ret = handle->perf_ops->device_opps_add(handle, cpu_dev);
>  	if (ret) {
>  		dev_warn(cpu_dev, "failed to add opps to the device\n");
>  		return ret;
> @@ -164,7 +164,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
>  	/* SCMI allows DVFS request for any domain from any CPU */
>  	policy->dvfs_possible_from_any_cpu = true;
>  
> -	latency = handle->perf_ops->get_transition_latency(handle, cpu_dev);
> +	latency = handle->perf_ops->transition_latency_get(handle, cpu_dev);
>  	if (!latency)
>  		latency = CPUFREQ_ETERNAL;
>  
> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
> index 987c64d19801..611ab08e6174 100644
> --- a/drivers/firmware/arm_scmi/perf.c
> +++ b/drivers/firmware/arm_scmi/perf.c
> @@ -349,8 +349,8 @@ static int scmi_dev_domain_id(struct device *dev)
>  	return clkspec.args[0];
>  }
>  
> -static int scmi_dvfs_add_opps_to_device(const struct scmi_handle *handle,
> -					struct device *dev)
> +static int scmi_dvfs_device_opps_add(const struct scmi_handle *handle,
> +				     struct device *dev)
>  {
>  	int idx, ret, domain;
>  	unsigned long freq;
> @@ -383,7 +383,7 @@ static int scmi_dvfs_add_opps_to_device(const struct scmi_handle *handle,
>  	return 0;
>  }
>  
> -static int scmi_dvfs_get_transition_latency(const struct scmi_handle *handle,
> +static int scmi_dvfs_transition_latency_get(const struct scmi_handle *handle,
>  					    struct device *dev)
>  {
>  	struct perf_dom_info *dom;
> @@ -432,8 +432,8 @@ static struct scmi_perf_ops perf_ops = {
>  	.level_set = scmi_perf_level_set,
>  	.level_get = scmi_perf_level_get,
>  	.device_domain_id = scmi_dev_domain_id,
> -	.get_transition_latency = scmi_dvfs_get_transition_latency,
> -	.add_opps_to_device = scmi_dvfs_add_opps_to_device,
> +	.transition_latency_get = scmi_dvfs_transition_latency_get,
> +	.device_opps_add = scmi_dvfs_device_opps_add,
>  	.freq_set = scmi_dvfs_freq_set,
>  	.freq_get = scmi_dvfs_freq_get,
>  };
> diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
> index a171c1e293e8..f4c9fc0fc755 100644
> --- a/include/linux/scmi_protocol.h
> +++ b/include/linux/scmi_protocol.h
> @@ -85,8 +85,8 @@ struct scmi_clk_ops {
>   * @level_set: sets the performance level of a domain
>   * @level_get: gets the performance level of a domain
>   * @device_domain_id: gets the scmi domain id for a given device
> - * @get_transition_latency: gets the DVFS transition latency for a given device
> - * @add_opps_to_device: adds all the OPPs for a given device
> + * @transition_latency_get: gets the DVFS transition latency for a given device
> + * @device_opps_add: adds all the OPPs for a given device
>   * @freq_set: sets the frequency for a given device using sustained frequency
>   *	to sustained performance level mapping
>   * @freq_get: gets the frequency for a given device using sustained frequency
> @@ -102,10 +102,10 @@ struct scmi_perf_ops {
>  	int (*level_get)(const struct scmi_handle *handle, u32 domain,
>  			 u32 *level, bool poll);
>  	int (*device_domain_id)(struct device *dev);
> -	int (*get_transition_latency)(const struct scmi_handle *handle,
> +	int (*transition_latency_get)(const struct scmi_handle *handle,
>  				      struct device *dev);
> -	int (*add_opps_to_device)(const struct scmi_handle *handle,
> -				  struct device *dev);
> +	int (*device_opps_add)(const struct scmi_handle *handle,
> +			       struct device *dev);
>  	int (*freq_set)(const struct scmi_handle *handle, u32 domain,
>  			unsigned long rate, bool poll);
>  	int (*freq_get)(const struct scmi_handle *handle, u32 domain,

^ permalink raw reply

* [PATCH 4/8] firmware: arm_scmi: rename scmi_xfer_{init,get,put}
From: Jonathan Cameron @ 2018-05-17  8:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1525885634-22348-5-git-send-email-sudeep.holla@arm.com>

On Wed, 9 May 2018 18:07:10 +0100
Sudeep Holla <sudeep.holla@arm.com> wrote:

> Just after the initial patches were queued, Jonathan Cameron mentioned
> that scmi_one_xfer_{get_put} were not very clear and suggested to use
> scmi_xfer_{alloc,free}. While I agree to some extent, the reason not to
> have alloc/free as these are preallocated buffers and these functions
> just returns a reference to free slot in that preallocated array.
> However it was agreed to drop "_one" as it's implicit that we are always
> dealing with one slot anyways.
> 
> This patch updates the name accordingly dropping "_one" in both {get,put}
> functions. Also scmi_one_xfer_init is renamed as scmi_xfer_get_init to
> reflect the fact that it gets the free slots and then initialise it.
> 
> Reported-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

Hi Sudeep,

Mostly fine, but one block of comment change that is unrelated has snuck
into this patch.  I think it should be in the earlier kernel-doc fix
up patch.

You have also been a little inconsistent on whether to add blank lines
before return ret statements.  This is really trivial so up to you on
whether to fix that up in v2.

With the doc line moved to the other patch.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/firmware/arm_scmi/base.c    | 23 +++++++++++++----------
>  drivers/firmware/arm_scmi/clock.c   | 24 ++++++++++++------------
>  drivers/firmware/arm_scmi/common.h  |  4 ++--
>  drivers/firmware/arm_scmi/driver.c  | 20 ++++++++++----------
>  drivers/firmware/arm_scmi/perf.c    | 28 ++++++++++++++--------------
>  drivers/firmware/arm_scmi/power.c   | 16 ++++++++--------
>  drivers/firmware/arm_scmi/sensors.c | 20 ++++++++++----------
>  7 files changed, 69 insertions(+), 66 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/base.c b/drivers/firmware/arm_scmi/base.c
> index c36ded9dbb83..9dff33ea6416 100644
> --- a/drivers/firmware/arm_scmi/base.c
> +++ b/drivers/firmware/arm_scmi/base.c
> @@ -37,7 +37,7 @@ static int scmi_base_attributes_get(const struct scmi_handle *handle)
>  	struct scmi_msg_resp_base_attributes *attr_info;
>  	struct scmi_revision_info *rev = handle->version;
>  
> -	ret = scmi_one_xfer_init(handle, PROTOCOL_ATTRIBUTES,
> +	ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES,
>  				 SCMI_PROTOCOL_BASE, 0, sizeof(*attr_info), &t);
>  	if (ret)
>  		return ret;
> @@ -49,7 +49,7 @@ static int scmi_base_attributes_get(const struct scmi_handle *handle)
>  		rev->num_agents = attr_info->num_agents;
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  
>  	return ret;
>  }
> @@ -81,7 +81,7 @@ scmi_base_vendor_id_get(const struct scmi_handle *handle, bool sub_vendor)
>  		size = ARRAY_SIZE(rev->vendor_id);
>  	}
>  
> -	ret = scmi_one_xfer_init(handle, cmd, SCMI_PROTOCOL_BASE, 0, size, &t);
> +	ret = scmi_xfer_get_init(handle, cmd, SCMI_PROTOCOL_BASE, 0, size, &t);
>  	if (ret)
>  		return ret;
>  
> @@ -89,7 +89,8 @@ scmi_base_vendor_id_get(const struct scmi_handle *handle, bool sub_vendor)
>  	if (!ret)
>  		memcpy(vendor_id, t->rx.buf, size);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
> +
>  	return ret;
>  }
>  
> @@ -110,7 +111,7 @@ scmi_base_implementation_version_get(const struct scmi_handle *handle)
>  	struct scmi_xfer *t;
>  	struct scmi_revision_info *rev = handle->version;
>  
> -	ret = scmi_one_xfer_init(handle, BASE_DISCOVER_IMPLEMENT_VERSION,
> +	ret = scmi_xfer_get_init(handle, BASE_DISCOVER_IMPLEMENT_VERSION,
>  				 SCMI_PROTOCOL_BASE, 0, sizeof(*impl_ver), &t);
>  	if (ret)
>  		return ret;
> @@ -121,7 +122,8 @@ scmi_base_implementation_version_get(const struct scmi_handle *handle)
>  		rev->impl_ver = le32_to_cpu(*impl_ver);
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
> +
>  	return ret;
>  }
>  
> @@ -144,7 +146,7 @@ static int scmi_base_implementation_list_get(const struct scmi_handle *handle,
>  	u32 tot_num_ret = 0, loop_num_ret;
>  	struct device *dev = handle->dev;
>  
> -	ret = scmi_one_xfer_init(handle, BASE_DISCOVER_LIST_PROTOCOLS,
> +	ret = scmi_xfer_get_init(handle, BASE_DISCOVER_LIST_PROTOCOLS,
>  				 SCMI_PROTOCOL_BASE, sizeof(*num_skip), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -173,7 +175,7 @@ static int scmi_base_implementation_list_get(const struct scmi_handle *handle,
>  		tot_num_ret += loop_num_ret;
>  	} while (loop_num_ret);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  
>  	return ret;
>  }
> @@ -196,7 +198,7 @@ static int scmi_base_discover_agent_get(const struct scmi_handle *handle,
>  	int ret;
>  	struct scmi_xfer *t;
>  
> -	ret = scmi_one_xfer_init(handle, BASE_DISCOVER_AGENT,
> +	ret = scmi_xfer_get_init(handle, BASE_DISCOVER_AGENT,
>  				 SCMI_PROTOCOL_BASE, sizeof(__le32),
>  				 SCMI_MAX_STR_SIZE, &t);
>  	if (ret)
> @@ -208,7 +210,8 @@ static int scmi_base_discover_agent_get(const struct scmi_handle *handle,
>  	if (!ret)
>  		memcpy(name, t->rx.buf, SCMI_MAX_STR_SIZE);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
> +

I actually agree that it is sensible to drop this extra line in here as you
are working on the related code (and it improves readability a tiny bit).
However, if you are going to do it, do them all.  There are other places
below that would benefit from this little change.

>  	return ret;
>  }
>  
> diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c
> index e6f17825db79..3874666a8a14 100644
> --- a/drivers/firmware/arm_scmi/clock.c
> +++ b/drivers/firmware/arm_scmi/clock.c
> @@ -77,7 +77,7 @@ static int scmi_clock_protocol_attributes_get(const struct scmi_handle *handle,
>  	struct scmi_xfer *t;
>  	struct scmi_msg_resp_clock_protocol_attributes *attr;
>  
> -	ret = scmi_one_xfer_init(handle, PROTOCOL_ATTRIBUTES,
> +	ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES,
>  				 SCMI_PROTOCOL_CLOCK, 0, sizeof(*attr), &t);
>  	if (ret)
>  		return ret;
> @@ -90,7 +90,7 @@ static int scmi_clock_protocol_attributes_get(const struct scmi_handle *handle,
>  		ci->max_async_req = attr->max_async_req;
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -101,7 +101,7 @@ static int scmi_clock_attributes_get(const struct scmi_handle *handle,
>  	struct scmi_xfer *t;
>  	struct scmi_msg_resp_clock_attributes *attr;
>  
> -	ret = scmi_one_xfer_init(handle, CLOCK_ATTRIBUTES, SCMI_PROTOCOL_CLOCK,
> +	ret = scmi_xfer_get_init(handle, CLOCK_ATTRIBUTES, SCMI_PROTOCOL_CLOCK,
>  				 sizeof(clk_id), sizeof(*attr), &t);
>  	if (ret)
>  		return ret;
> @@ -115,7 +115,7 @@ static int scmi_clock_attributes_get(const struct scmi_handle *handle,
>  	else
>  		clk->name[0] = '\0';
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -132,7 +132,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
>  	struct scmi_msg_clock_describe_rates *clk_desc;
>  	struct scmi_msg_resp_clock_describe_rates *rlist;
>  
> -	ret = scmi_one_xfer_init(handle, CLOCK_DESCRIBE_RATES,
> +	ret = scmi_xfer_get_init(handle, CLOCK_DESCRIBE_RATES,
>  				 SCMI_PROTOCOL_CLOCK, sizeof(*clk_desc), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -186,7 +186,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
>  		clk->list.num_rates = tot_rate_cnt;
>  
>  err:
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -196,7 +196,7 @@ scmi_clock_rate_get(const struct scmi_handle *handle, u32 clk_id, u64 *value)
>  	int ret;
>  	struct scmi_xfer *t;
>  
> -	ret = scmi_one_xfer_init(handle, CLOCK_RATE_GET, SCMI_PROTOCOL_CLOCK,
> +	ret = scmi_xfer_get_init(handle, CLOCK_RATE_GET, SCMI_PROTOCOL_CLOCK,
>  				 sizeof(__le32), sizeof(u64), &t);
>  	if (ret)
>  		return ret;
> @@ -211,7 +211,7 @@ scmi_clock_rate_get(const struct scmi_handle *handle, u32 clk_id, u64 *value)
>  		*value |= (u64)le32_to_cpu(*(pval + 1)) << 32;
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -222,7 +222,7 @@ static int scmi_clock_rate_set(const struct scmi_handle *handle, u32 clk_id,
>  	struct scmi_xfer *t;
>  	struct scmi_clock_set_rate *cfg;
>  
> -	ret = scmi_one_xfer_init(handle, CLOCK_RATE_SET, SCMI_PROTOCOL_CLOCK,
> +	ret = scmi_xfer_get_init(handle, CLOCK_RATE_SET, SCMI_PROTOCOL_CLOCK,
>  				 sizeof(*cfg), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -235,7 +235,7 @@ static int scmi_clock_rate_set(const struct scmi_handle *handle, u32 clk_id,
>  
>  	ret = scmi_do_xfer(handle, t);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -246,7 +246,7 @@ scmi_clock_config_set(const struct scmi_handle *handle, u32 clk_id, u32 config)
>  	struct scmi_xfer *t;
>  	struct scmi_clock_set_config *cfg;
>  
> -	ret = scmi_one_xfer_init(handle, CLOCK_CONFIG_SET, SCMI_PROTOCOL_CLOCK,
> +	ret = scmi_xfer_get_init(handle, CLOCK_CONFIG_SET, SCMI_PROTOCOL_CLOCK,
>  				 sizeof(*cfg), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -257,7 +257,7 @@ scmi_clock_config_set(const struct scmi_handle *handle, u32 clk_id, u32 config)
>  
>  	ret = scmi_do_xfer(handle, t);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
> index 0821662a4633..41b03e46cca8 100644
> --- a/drivers/firmware/arm_scmi/common.h
> +++ b/drivers/firmware/arm_scmi/common.h
> @@ -95,9 +95,9 @@ struct scmi_xfer {
>  	struct completion done;
>  };
>  
> -void scmi_one_xfer_put(const struct scmi_handle *h, struct scmi_xfer *xfer);
> +void scmi_xfer_put(const struct scmi_handle *h, struct scmi_xfer *xfer);
>  int scmi_do_xfer(const struct scmi_handle *h, struct scmi_xfer *xfer);
> -int scmi_one_xfer_init(const struct scmi_handle *h, u8 msg_id, u8 prot_id,
> +int scmi_xfer_get_init(const struct scmi_handle *h, u8 msg_id, u8 prot_id,
>  		       size_t tx_size, size_t rx_size, struct scmi_xfer **p);
>  int scmi_handle_put(const struct scmi_handle *handle);
>  struct scmi_handle *scmi_handle_get(struct device *dev);
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 6fee11f06a66..33d2b78af3ff 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -295,7 +295,7 @@ static void scmi_tx_prepare(struct mbox_client *cl, void *m)
>   *
>   * Return: 0 if all went fine, else corresponding error.
>   */
> -static struct scmi_xfer *scmi_one_xfer_get(const struct scmi_handle *handle)
> +static struct scmi_xfer *scmi_xfer_get(const struct scmi_handle *handle)
>  {
>  	u16 xfer_id;
>  	struct scmi_xfer *xfer;
> @@ -324,14 +324,14 @@ static struct scmi_xfer *scmi_one_xfer_get(const struct scmi_handle *handle)
>  }
>  
>  /**
> - * scmi_one_xfer_put() - Release a message
> + * scmi_xfer_put() - Release a message
>   *
>   * @handle: Pointer to SCMI entity handle
>   * @xfer: message that was reserved by scmi_xfer_get
>   *
>   * This holds a spinlock to maintain integrity of internal data structures.
>   */
> -void scmi_one_xfer_put(const struct scmi_handle *handle, struct scmi_xfer *xfer)
> +void scmi_xfer_put(const struct scmi_handle *handle, struct scmi_xfer *xfer)
>  {
>  	unsigned long flags;
>  	struct scmi_info *info = handle_to_scmi_info(handle);
> @@ -436,7 +436,7 @@ int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer)
>  }
>  
>  /**
> - * scmi_one_xfer_init() - Allocate and initialise one message
> + * scmi_xfer_get_init() - Allocate and initialise one message
>   *
>   * @handle: Pointer to SCMI entity handle
>   * @msg_id: Message identifier
> @@ -445,13 +445,13 @@ int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer)
>   * @rx_size: receive message size
>   * @p: pointer to the allocated and initialised message
>   *
> - * This function allocates the message using @scmi_one_xfer_get and
> + * This function allocates the message using @scmi_xfer_get and
>   * initialise the header.
>   *
>   * Return: 0 if all went fine with @p pointing to message, else
>   *	corresponding error.
>   */
> -int scmi_one_xfer_init(const struct scmi_handle *handle, u8 msg_id, u8 prot_id,
> +int scmi_xfer_get_init(const struct scmi_handle *handle, u8 msg_id, u8 prot_id,
>  		       size_t tx_size, size_t rx_size, struct scmi_xfer **p)
>  {
>  	int ret;
> @@ -464,7 +464,7 @@ int scmi_one_xfer_init(const struct scmi_handle *handle, u8 msg_id, u8 prot_id,
>  	    tx_size > info->desc->max_msg_size)
>  		return -ERANGE;
>  
> -	xfer = scmi_one_xfer_get(handle);
> +	xfer = scmi_xfer_get(handle);
>  	if (IS_ERR(xfer)) {
>  		ret = PTR_ERR(xfer);
>  		dev_err(dev, "failed to get free message slot(%d)\n", ret);
> @@ -500,7 +500,7 @@ int scmi_version_get(const struct scmi_handle *handle, u8 protocol,
>  	__le32 *rev_info;
>  	struct scmi_xfer *t;
>  
> -	ret = scmi_one_xfer_init(handle, PROTOCOL_VERSION, protocol, 0,
> +	ret = scmi_xfer_get_init(handle, PROTOCOL_VERSION, protocol, 0,
>  				 sizeof(*version), &t);
>  	if (ret)
>  		return ret;
> @@ -511,7 +511,7 @@ int scmi_version_get(const struct scmi_handle *handle, u8 protocol,
>  		*version = le32_to_cpu(*rev_info);
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -539,7 +539,7 @@ scmi_is_protocol_implemented(const struct scmi_handle *handle, u8 prot_id)
>  }
>  
>  /**
> - * scmi_handle_get() - Get the  SCMI handle for a device
> + * scmi_handle_get() - Get the SCMI handle for a device

This wants to be in the earlier documentation fix patch not here.

>   *
>   * @dev: pointer to device for which we want SCMI handle
>   *
> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
> index 611ab08e6174..2a219b1261b1 100644
> --- a/drivers/firmware/arm_scmi/perf.c
> +++ b/drivers/firmware/arm_scmi/perf.c
> @@ -115,7 +115,7 @@ static int scmi_perf_attributes_get(const struct scmi_handle *handle,
>  	struct scmi_xfer *t;
>  	struct scmi_msg_resp_perf_attributes *attr;
>  
> -	ret = scmi_one_xfer_init(handle, PROTOCOL_ATTRIBUTES,
> +	ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES,
>  				 SCMI_PROTOCOL_PERF, 0, sizeof(*attr), &t);
>  	if (ret)
>  		return ret;
> @@ -133,7 +133,7 @@ static int scmi_perf_attributes_get(const struct scmi_handle *handle,
>  		pi->stats_size = le32_to_cpu(attr->stats_size);
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -145,7 +145,7 @@ scmi_perf_domain_attributes_get(const struct scmi_handle *handle, u32 domain,
>  	struct scmi_xfer *t;
>  	struct scmi_msg_resp_perf_domain_attributes *attr;
>  
> -	ret = scmi_one_xfer_init(handle, PERF_DOMAIN_ATTRIBUTES,
> +	ret = scmi_xfer_get_init(handle, PERF_DOMAIN_ATTRIBUTES,
>  				 SCMI_PROTOCOL_PERF, sizeof(domain),
>  				 sizeof(*attr), &t);
>  	if (ret)
> @@ -171,7 +171,7 @@ scmi_perf_domain_attributes_get(const struct scmi_handle *handle, u32 domain,
>  		memcpy(dom_info->name, attr->name, SCMI_MAX_STR_SIZE);
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -194,7 +194,7 @@ scmi_perf_describe_levels_get(const struct scmi_handle *handle, u32 domain,
>  	struct scmi_msg_perf_describe_levels *dom_info;
>  	struct scmi_msg_resp_perf_describe_levels *level_info;
>  
> -	ret = scmi_one_xfer_init(handle, PERF_DESCRIBE_LEVELS,
> +	ret = scmi_xfer_get_init(handle, PERF_DESCRIBE_LEVELS,
>  				 SCMI_PROTOCOL_PERF, sizeof(*dom_info), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -237,7 +237,7 @@ scmi_perf_describe_levels_get(const struct scmi_handle *handle, u32 domain,
>  	} while (num_returned && num_remaining);
>  
>  	perf_dom->opp_count = tot_opp_cnt;
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  
>  	sort(perf_dom->opp, tot_opp_cnt, sizeof(*opp), opp_cmp_func, NULL);
>  	return ret;
> @@ -250,7 +250,7 @@ static int scmi_perf_limits_set(const struct scmi_handle *handle, u32 domain,
>  	struct scmi_xfer *t;
>  	struct scmi_perf_set_limits *limits;
>  
> -	ret = scmi_one_xfer_init(handle, PERF_LIMITS_SET, SCMI_PROTOCOL_PERF,
> +	ret = scmi_xfer_get_init(handle, PERF_LIMITS_SET, SCMI_PROTOCOL_PERF,
>  				 sizeof(*limits), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -262,7 +262,7 @@ static int scmi_perf_limits_set(const struct scmi_handle *handle, u32 domain,
>  
>  	ret = scmi_do_xfer(handle, t);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -273,7 +273,7 @@ static int scmi_perf_limits_get(const struct scmi_handle *handle, u32 domain,
>  	struct scmi_xfer *t;
>  	struct scmi_perf_get_limits *limits;
>  
> -	ret = scmi_one_xfer_init(handle, PERF_LIMITS_GET, SCMI_PROTOCOL_PERF,
> +	ret = scmi_xfer_get_init(handle, PERF_LIMITS_GET, SCMI_PROTOCOL_PERF,
>  				 sizeof(__le32), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -288,7 +288,7 @@ static int scmi_perf_limits_get(const struct scmi_handle *handle, u32 domain,
>  		*min_perf = le32_to_cpu(limits->min_level);
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -299,7 +299,7 @@ static int scmi_perf_level_set(const struct scmi_handle *handle, u32 domain,
>  	struct scmi_xfer *t;
>  	struct scmi_perf_set_level *lvl;
>  
> -	ret = scmi_one_xfer_init(handle, PERF_LEVEL_SET, SCMI_PROTOCOL_PERF,
> +	ret = scmi_xfer_get_init(handle, PERF_LEVEL_SET, SCMI_PROTOCOL_PERF,
>  				 sizeof(*lvl), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -311,7 +311,7 @@ static int scmi_perf_level_set(const struct scmi_handle *handle, u32 domain,
>  
>  	ret = scmi_do_xfer(handle, t);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -321,7 +321,7 @@ static int scmi_perf_level_get(const struct scmi_handle *handle, u32 domain,
>  	int ret;
>  	struct scmi_xfer *t;
>  
> -	ret = scmi_one_xfer_init(handle, PERF_LEVEL_GET, SCMI_PROTOCOL_PERF,
> +	ret = scmi_xfer_get_init(handle, PERF_LEVEL_GET, SCMI_PROTOCOL_PERF,
>  				 sizeof(u32), sizeof(u32), &t);
>  	if (ret)
>  		return ret;
> @@ -333,7 +333,7 @@ static int scmi_perf_level_get(const struct scmi_handle *handle, u32 domain,
>  	if (!ret)
>  		*level = le32_to_cpu(*(__le32 *)t->rx.buf);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> diff --git a/drivers/firmware/arm_scmi/power.c b/drivers/firmware/arm_scmi/power.c
> index 087c2876cdf2..cfa033b05aed 100644
> --- a/drivers/firmware/arm_scmi/power.c
> +++ b/drivers/firmware/arm_scmi/power.c
> @@ -63,7 +63,7 @@ static int scmi_power_attributes_get(const struct scmi_handle *handle,
>  	struct scmi_xfer *t;
>  	struct scmi_msg_resp_power_attributes *attr;
>  
> -	ret = scmi_one_xfer_init(handle, PROTOCOL_ATTRIBUTES,
> +	ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES,
>  				 SCMI_PROTOCOL_POWER, 0, sizeof(*attr), &t);
>  	if (ret)
>  		return ret;
> @@ -78,7 +78,7 @@ static int scmi_power_attributes_get(const struct scmi_handle *handle,
>  		pi->stats_size = le32_to_cpu(attr->stats_size);
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -90,7 +90,7 @@ scmi_power_domain_attributes_get(const struct scmi_handle *handle, u32 domain,
>  	struct scmi_xfer *t;
>  	struct scmi_msg_resp_power_domain_attributes *attr;
>  
> -	ret = scmi_one_xfer_init(handle, POWER_DOMAIN_ATTRIBUTES,
> +	ret = scmi_xfer_get_init(handle, POWER_DOMAIN_ATTRIBUTES,
>  				 SCMI_PROTOCOL_POWER, sizeof(domain),
>  				 sizeof(*attr), &t);
>  	if (ret)
> @@ -109,7 +109,7 @@ scmi_power_domain_attributes_get(const struct scmi_handle *handle, u32 domain,
>  		memcpy(dom_info->name, attr->name, SCMI_MAX_STR_SIZE);
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -120,7 +120,7 @@ scmi_power_state_set(const struct scmi_handle *handle, u32 domain, u32 state)
>  	struct scmi_xfer *t;
>  	struct scmi_power_set_state *st;
>  
> -	ret = scmi_one_xfer_init(handle, POWER_STATE_SET, SCMI_PROTOCOL_POWER,
> +	ret = scmi_xfer_get_init(handle, POWER_STATE_SET, SCMI_PROTOCOL_POWER,
>  				 sizeof(*st), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -132,7 +132,7 @@ scmi_power_state_set(const struct scmi_handle *handle, u32 domain, u32 state)
>  
>  	ret = scmi_do_xfer(handle, t);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -142,7 +142,7 @@ scmi_power_state_get(const struct scmi_handle *handle, u32 domain, u32 *state)
>  	int ret;
>  	struct scmi_xfer *t;
>  
> -	ret = scmi_one_xfer_init(handle, POWER_STATE_GET, SCMI_PROTOCOL_POWER,
> +	ret = scmi_xfer_get_init(handle, POWER_STATE_GET, SCMI_PROTOCOL_POWER,
>  				 sizeof(u32), sizeof(u32), &t);
>  	if (ret)
>  		return ret;
> @@ -153,7 +153,7 @@ scmi_power_state_get(const struct scmi_handle *handle, u32 domain, u32 *state)
>  	if (!ret)
>  		*state = le32_to_cpu(*(__le32 *)t->rx.buf);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c
> index bbb469fea0ed..27f2092b9882 100644
> --- a/drivers/firmware/arm_scmi/sensors.c
> +++ b/drivers/firmware/arm_scmi/sensors.c
> @@ -79,7 +79,7 @@ static int scmi_sensor_attributes_get(const struct scmi_handle *handle,
>  	struct scmi_xfer *t;
>  	struct scmi_msg_resp_sensor_attributes *attr;
>  
> -	ret = scmi_one_xfer_init(handle, PROTOCOL_ATTRIBUTES,
> +	ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES,
>  				 SCMI_PROTOCOL_SENSOR, 0, sizeof(*attr), &t);
>  	if (ret)
>  		return ret;
> @@ -95,7 +95,7 @@ static int scmi_sensor_attributes_get(const struct scmi_handle *handle,
>  		si->reg_size = le32_to_cpu(attr->reg_size);
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -108,7 +108,7 @@ static int scmi_sensor_description_get(const struct scmi_handle *handle,
>  	struct scmi_xfer *t;
>  	struct scmi_msg_resp_sensor_description *buf;
>  
> -	ret = scmi_one_xfer_init(handle, SENSOR_DESCRIPTION_GET,
> +	ret = scmi_xfer_get_init(handle, SENSOR_DESCRIPTION_GET,
>  				 SCMI_PROTOCOL_SENSOR, sizeof(__le32), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -150,7 +150,7 @@ static int scmi_sensor_description_get(const struct scmi_handle *handle,
>  		 */
>  	} while (num_returned && num_remaining);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -162,7 +162,7 @@ scmi_sensor_configuration_set(const struct scmi_handle *handle, u32 sensor_id)
>  	struct scmi_xfer *t;
>  	struct scmi_msg_set_sensor_config *cfg;
>  
> -	ret = scmi_one_xfer_init(handle, SENSOR_CONFIG_SET,
> +	ret = scmi_xfer_get_init(handle, SENSOR_CONFIG_SET,
>  				 SCMI_PROTOCOL_SENSOR, sizeof(*cfg), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -173,7 +173,7 @@ scmi_sensor_configuration_set(const struct scmi_handle *handle, u32 sensor_id)
>  
>  	ret = scmi_do_xfer(handle, t);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -185,7 +185,7 @@ static int scmi_sensor_trip_point_set(const struct scmi_handle *handle,
>  	struct scmi_xfer *t;
>  	struct scmi_msg_set_sensor_trip_point *trip;
>  
> -	ret = scmi_one_xfer_init(handle, SENSOR_TRIP_POINT_SET,
> +	ret = scmi_xfer_get_init(handle, SENSOR_TRIP_POINT_SET,
>  				 SCMI_PROTOCOL_SENSOR, sizeof(*trip), 0, &t);
>  	if (ret)
>  		return ret;
> @@ -198,7 +198,7 @@ static int scmi_sensor_trip_point_set(const struct scmi_handle *handle,
>  
>  	ret = scmi_do_xfer(handle, t);
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  
> @@ -209,7 +209,7 @@ static int scmi_sensor_reading_get(const struct scmi_handle *handle,
>  	struct scmi_xfer *t;
>  	struct scmi_msg_sensor_reading_get *sensor;
>  
> -	ret = scmi_one_xfer_init(handle, SENSOR_READING_GET,
> +	ret = scmi_xfer_get_init(handle, SENSOR_READING_GET,
>  				 SCMI_PROTOCOL_SENSOR, sizeof(*sensor),
>  				 sizeof(u64), &t);
>  	if (ret)
> @@ -227,7 +227,7 @@ static int scmi_sensor_reading_get(const struct scmi_handle *handle,
>  		*value |= (u64)le32_to_cpu(*(pval + 1)) << 32;
>  	}
>  
> -	scmi_one_xfer_put(handle, t);
> +	scmi_xfer_put(handle, t);
>  	return ret;
>  }
>  

^ permalink raw reply

* [PATCH 1/2] clk: imx7d: correct enet clock CCGR register offset
From: Anson Huang @ 2018-05-17  8:40 UTC (permalink / raw)
  To: linux-arm-kernel

Correct enet clock CCGR register offset.

CCGR6: IMX7D_ENET_AXI_ROOT_CLK (enet1 and enet2 bus clocks)
CCGR112: IMX7D_ENET1_TIME_ROOT_CLK, IMX7D_ENET1_IPG_ROOT_CLK
CCGR113: IMX7D_ENET2_TIME_ROOT_CLK, IMX7D_ENET2_IPG_ROOT_CLK

IMX7D_ENET_PHY_REF_ROOT_DIV supplies clock for PHY,
no gate after this clock, its parent clock root has gate.
IMX7D_ENET1_REF_ROOT_DIV/IMX7D_ENET2_REF_ROOT_DIV supplies clocks
for enet IPG_CLK_RMII, no gate after the clock, its parent
clock root has gate.

IMX7D_PLL_ENET_MAIN_125M_CLK (anatop pll) supplies clock for
enet RGMII tx_clk.

Based on Andy Duan's patch from the NXP kernel tree.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/clk/imx/clk-imx7d.c             | 11 ++++++-----
 include/dt-bindings/clock/imx7d-clock.h |  4 +++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c
index 975a20d..485ab49 100644
--- a/drivers/clk/imx/clk-imx7d.c
+++ b/drivers/clk/imx/clk-imx7d.c
@@ -26,6 +26,8 @@ static u32 share_count_sai1;
 static u32 share_count_sai2;
 static u32 share_count_sai3;
 static u32 share_count_nand;
+static u32 share_count_enet1;
+static u32 share_count_enet2;
 
 static const struct clk_div_table test_div_table[] = {
 	{ .val = 3, .div = 1, },
@@ -805,6 +807,10 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
 	clks[IMX7D_MIPI_DSI_ROOT_CLK] = imx_clk_gate4("mipi_dsi_root_clk", "mipi_dsi_post_div", base + 0x4650, 0);
 	clks[IMX7D_MIPI_CSI_ROOT_CLK] = imx_clk_gate4("mipi_csi_root_clk", "mipi_csi_post_div", base + 0x4640, 0);
 	clks[IMX7D_MIPI_DPHY_ROOT_CLK] = imx_clk_gate4("mipi_dphy_root_clk", "mipi_dphy_post_div", base + 0x4660, 0);
+	clks[IMX7D_ENET1_IPG_ROOT_CLK] = imx_clk_gate2_shared2("enet1_ipg_root_clk", "enet_axi_post_div", base + 0x4700, 0, &share_count_enet1);
+	clks[IMX7D_ENET1_TIME_ROOT_CLK] = imx_clk_gate2_shared2("enet1_time_root_clk", "enet1_time_post_div", base + 0x4700, 0, &share_count_enet1);
+	clks[IMX7D_ENET2_IPG_ROOT_CLK] = imx_clk_gate2_shared2("enet2_ipg_root_clk", "enet_axi_post_div", base + 0x4710, 0, &share_count_enet2);
+	clks[IMX7D_ENET2_TIME_ROOT_CLK] = imx_clk_gate2_shared2("enet2_time_root_clk", "enet2_time_post_div", base + 0x4710, 0, &share_count_enet2);
 	clks[IMX7D_SAI1_ROOT_CLK] = imx_clk_gate2_shared2("sai1_root_clk", "sai1_post_div", base + 0x48c0, 0, &share_count_sai1);
 	clks[IMX7D_SAI1_IPG_CLK]  = imx_clk_gate2_shared2("sai1_ipg_clk",  "ipg_root_clk",  base + 0x48c0, 0, &share_count_sai1);
 	clks[IMX7D_SAI2_ROOT_CLK] = imx_clk_gate2_shared2("sai2_root_clk", "sai2_post_div", base + 0x48d0, 0, &share_count_sai2);
@@ -812,11 +818,6 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
 	clks[IMX7D_SAI3_ROOT_CLK] = imx_clk_gate2_shared2("sai3_root_clk", "sai3_post_div", base + 0x48e0, 0, &share_count_sai3);
 	clks[IMX7D_SAI3_IPG_CLK]  = imx_clk_gate2_shared2("sai3_ipg_clk",  "ipg_root_clk",  base + 0x48e0, 0, &share_count_sai3);
 	clks[IMX7D_SPDIF_ROOT_CLK] = imx_clk_gate4("spdif_root_clk", "spdif_post_div", base + 0x44d0, 0);
-	clks[IMX7D_ENET1_REF_ROOT_CLK] = imx_clk_gate4("enet1_ref_root_clk", "enet1_ref_post_div", base + 0x44e0, 0);
-	clks[IMX7D_ENET1_TIME_ROOT_CLK] = imx_clk_gate4("enet1_time_root_clk", "enet1_time_post_div", base + 0x44f0, 0);
-	clks[IMX7D_ENET2_REF_ROOT_CLK] = imx_clk_gate4("enet2_ref_root_clk", "enet2_ref_post_div", base + 0x4500, 0);
-	clks[IMX7D_ENET2_TIME_ROOT_CLK] = imx_clk_gate4("enet2_time_root_clk", "enet2_time_post_div", base + 0x4510, 0);
-	clks[IMX7D_ENET_PHY_REF_ROOT_CLK] = imx_clk_gate4("enet_phy_ref_root_clk", "enet_phy_ref_post_div", base + 0x4520, 0);
 	clks[IMX7D_EIM_ROOT_CLK] = imx_clk_gate4("eim_root_clk", "eim_post_div", base + 0x4160, 0);
 	clks[IMX7D_NAND_RAWNAND_CLK] = imx_clk_gate2_shared2("nand_rawnand_clk", "nand_root_clk", base + 0x4140, 0, &share_count_nand);
 	clks[IMX7D_NAND_USDHC_BUS_RAWNAND_CLK] = imx_clk_gate2_shared2("nand_usdhc_rawnand_clk", "nand_usdhc_root_clk", base + 0x4140, 0, &share_count_nand);
diff --git a/include/dt-bindings/clock/imx7d-clock.h b/include/dt-bindings/clock/imx7d-clock.h
index b2325d3e2..fef0647 100644
--- a/include/dt-bindings/clock/imx7d-clock.h
+++ b/include/dt-bindings/clock/imx7d-clock.h
@@ -455,5 +455,7 @@
 #define IMX7D_SNVS_CLK			442
 #define IMX7D_CAAM_CLK			443
 #define IMX7D_KPP_ROOT_CLK		444
-#define IMX7D_CLK_END			445
+#define IMX7D_ENET1_IPG_ROOT_CLK        445
+#define IMX7D_ENET2_IPG_ROOT_CLK        446
+#define IMX7D_CLK_END			447
 #endif /* __DT_BINDINGS_CLOCK_IMX7D_H */
-- 
2.7.4

^ permalink raw reply related

* [PATCH 2/2] ARM: dts: imx7: correct enet clock settings
From: Anson Huang @ 2018-05-17  8:40 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1526546422-7431-1-git-send-email-Anson.Huang@nxp.com>

This patch corrects ENET "ipg" and "enet_out"
clock settings according to clock driver's changes.

Based on Andy Duan's patch from the NXP kernel tree.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 arch/arm/boot/dts/imx7d.dtsi | 4 ++--
 arch/arm/boot/dts/imx7s.dtsi | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
index 200714e..92022ea 100644
--- a/arch/arm/boot/dts/imx7d.dtsi
+++ b/arch/arm/boot/dts/imx7d.dtsi
@@ -120,11 +120,11 @@
 			<GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
 			<GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
 			<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
-		clocks = <&clks IMX7D_ENET_AXI_ROOT_CLK>,
+		clocks = <&clks IMX7D_ENET2_IPG_ROOT_CLK>,
 			<&clks IMX7D_ENET_AXI_ROOT_CLK>,
 			<&clks IMX7D_ENET2_TIME_ROOT_CLK>,
 			<&clks IMX7D_PLL_ENET_MAIN_125M_CLK>,
-			<&clks IMX7D_ENET_PHY_REF_ROOT_CLK>;
+			<&clks IMX7D_ENET_PHY_REF_ROOT_DIV>;
 		clock-names = "ipg", "ahb", "ptp",
 			"enet_clk_ref", "enet_out";
 		fsl,num-tx-queues=<3>;
diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index 4d42335..cf4ba53 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -1091,11 +1091,11 @@
 					<GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
 					<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
 					<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clks IMX7D_ENET_AXI_ROOT_CLK>,
+				clocks = <&clks IMX7D_ENET1_IPG_ROOT_CLK>,
 					<&clks IMX7D_ENET_AXI_ROOT_CLK>,
 					<&clks IMX7D_ENET1_TIME_ROOT_CLK>,
 					<&clks IMX7D_PLL_ENET_MAIN_125M_CLK>,
-					<&clks IMX7D_ENET_PHY_REF_ROOT_CLK>;
+					<&clks IMX7D_ENET_PHY_REF_ROOT_DIV>;
 				clock-names = "ipg", "ahb", "ptp",
 					"enet_clk_ref", "enet_out";
 				fsl,num-tx-queues=<3>;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 2/3] clk: renesas: r8a7795: Add ccree clock
From: Geert Uytterhoeven @ 2018-05-17  8:41 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAOtvUMf0pnX1+MOz0KkB5LxqL5HTmLRYjVZTUrAx-eCvm26+LA@mail.gmail.com>

Hi Gilad,

On Thu, May 17, 2018 at 10:00 AM, Gilad Ben-Yossef <gilad@benyossef.com> wrote:
> On Tue, May 15, 2018 at 5:47 PM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
>> On Tue, May 15, 2018 at 2:29 PM, Gilad Ben-Yossef <gilad@benyossef.com> wrote:
>>> This patch adds the clock used by the CryptoCell 630p instance in the SoC.
>>>
>>> Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
>>
>> Thanks for your patch!
>>
>>> --- a/drivers/clk/renesas/r8a7795-cpg-mssr.c
>>> +++ b/drivers/clk/renesas/r8a7795-cpg-mssr.c
>>> @@ -132,6 +132,7 @@ static struct mssr_mod_clk r8a7795_mod_clks[] __initdata = {
>>>         DEF_MOD("sys-dmac2",             217,   R8A7795_CLK_S0D3),
>>>         DEF_MOD("sys-dmac1",             218,   R8A7795_CLK_S0D3),
>>>         DEF_MOD("sys-dmac0",             219,   R8A7795_CLK_S0D3),
>>> +       DEF_MOD("ccree",                 229,   R8A7795_CLK_S3D2),
>>
>> I don't know if "ccree" is the proper name for this clock, as there
>> may be multiple
>> instances.
>
> I'd be happy to rename it to anything else. Suggestions?

I believe it should be called "sceg-pub".

>> I also can't verify the parent clock.
>
> I'm afraid I can't really help. This is based on code snippet from
> Renesas. I verified it works but
> I am not an expert on the clock settings :-(

As your driver doesn't care about the clock rate, only about
enabling/disabling the clock, the actual parent doesn't matter much.

After some deeper diving into the datasheet, I believe the correct parent is
the CR clock, which is unfortunately not yet supported by the R-Car H3 clock
driver. I'll send a patch...

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* [PATCH 5/8] firmware: arm_scmi: drop unused `con_priv` structure member
From: Jonathan Cameron @ 2018-05-17  8:41 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1525885634-22348-6-git-send-email-sudeep.holla@arm.com>

On Wed, 9 May 2018 18:07:11 +0100
Sudeep Holla <sudeep.holla@arm.com> wrote:

> Initially con_priv was supposedly used for transport specific data when
> the SCMI driver had an abstraction to communicate with different mailbox
> controllers. But after some discussions, the idea was dropped but this
> variable slipped through the cracks.
> 
> This patch gets rid of this unused variable.
> 
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

Curious that it never had any docs :)  I'm glad we didn't add them two patches
earlier to remove them here as that would have been silly.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/firmware/arm_scmi/common.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
> index 41b03e46cca8..937a930ce87d 100644
> --- a/drivers/firmware/arm_scmi/common.h
> +++ b/drivers/firmware/arm_scmi/common.h
> @@ -86,9 +86,7 @@ struct scmi_msg {
>   *	buffer for the rx path as we use for the tx path.
>   * @done: completion event
>   */
> -
>  struct scmi_xfer {
> -	void *con_priv;
>  	struct scmi_msg_hdr hdr;
>  	struct scmi_msg tx;
>  	struct scmi_msg rx;

^ permalink raw reply

* [PATCH 6/8] firmware: arm_scmi: remove unnecessary bitmap_zero
From: Jonathan Cameron @ 2018-05-17  8:43 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1525885634-22348-7-git-send-email-sudeep.holla@arm.com>

On Wed, 9 May 2018 18:07:12 +0100
Sudeep Holla <sudeep.holla@arm.com> wrote:

> kcalloc zeros the memory and it's totally unnecessary to zero the bitmap
> again using bitmap_zero. This patch just drops the unnecessary use of
> the bitmap_zero in the context.
> 
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/firmware/arm_scmi/driver.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 33d2b78af3ff..4087d6c50ecd 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -636,8 +636,6 @@ static int scmi_xfer_info_init(struct scmi_info *sinfo)
>  	if (!info->xfer_alloc_table)
>  		return -ENOMEM;
>  
> -	bitmap_zero(info->xfer_alloc_table, desc->max_msg);
> -
>  	/* Pre-initialize the buffer pointer to pre-allocated buffers */
>  	for (i = 0, xfer = info->xfer_block; i < desc->max_msg; i++, xfer++) {
>  		xfer->rx.buf = devm_kcalloc(dev, sizeof(u8), desc->max_msg_size,

^ permalink raw reply

* [PATCH 1/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable
From: Daniel Mack @ 2018-05-17  8:48 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180516170333.GA21971@dtor-ws>

Hi Dmitry,

On Wednesday, May 16, 2018 07:03 PM, Dmitry Torokhov wrote:
>> diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
>> index 5bf63f76ddda..955f085627fa 100644
>> --- a/drivers/input/touchscreen/edt-ft5x06.c
>> +++ b/drivers/input/touchscreen/edt-ft5x06.c
>> @@ -1007,7 +1007,8 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
>>   		goto err_remove_attrs;
>>   
>>   	edt_ft5x06_ts_prepare_debugfs(tsdata, dev_driver_string(&client->dev));
>> -	device_init_wakeup(&client->dev, 1);
>> +	device_init_wakeup(&client->dev,
>> +			    device_property_read_bool(dev, "wakeup-source"));
> 
> I think we should actually drop device_init_wakeup() call. I2C core
> already handles "wakeup-source" property (for OF). The static board
> files can instantiate clients with I2C_CLIENT_WAKE, so that's handled
> too, and I think ACPI has its own notion of annotating wakeup sources.

Ah, right! Thanks, will respin :)


Daniel

^ permalink raw reply

* [PATCH 5/6] ARM: dts: rcar-gen2: Remove unused VIN properties
From: jacopo mondi @ 2018-05-17  9:01 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180516221307.GF17948@bigcity.dyn.berto.se>

Hi Niklas,

On Thu, May 17, 2018 at 12:13:07AM +0200, Niklas S?derlund wrote:
> Hi Jacopo,
>
> Thanks for your work.
>
> On 2018-05-16 18:32:31 +0200, Jacopo Mondi wrote:
> > The 'bus-width' and 'pclk-sample' properties are not parsed by the VIN
> > driver and only confuse users. Remove them in all Gen2 SoC that used
> > them.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > ---
> >  arch/arm/boot/dts/r8a7790-lager.dts   | 3 ---
> >  arch/arm/boot/dts/r8a7791-koelsch.dts | 3 ---
> >  arch/arm/boot/dts/r8a7791-porter.dts  | 1 -
> >  arch/arm/boot/dts/r8a7793-gose.dts    | 3 ---
> >  arch/arm/boot/dts/r8a7794-alt.dts     | 1 -
> >  arch/arm/boot/dts/r8a7794-silk.dts    | 1 -
> >  6 files changed, 12 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
> > index 063fdb6..b56b309 100644
> > --- a/arch/arm/boot/dts/r8a7790-lager.dts
> > +++ b/arch/arm/boot/dts/r8a7790-lager.dts
> > @@ -873,10 +873,8 @@
> >  	port {
> >  		vin0ep2: endpoint {
> >  			remote-endpoint = <&adv7612_out>;
> > -			bus-width = <24>;
>
> I can't really make up my mind if this is a good thing or not. Device
> tree describes the hardware and not what the drivers make use of. And
> the fact is that this bus is 24 bits wide. So I'm not sure we should
> remove these properties. But I would love to hear what others think
> about this.
>

Just to point out those properties are not even documented in rcar-vin
bindings (actually, none of them was).

I feel it's wrong to have them here, as someone may think that
changing their value should actually change the VIN interface behavior,
which it's not true, leading to massive confusion and quite some code
digging for no reason (and they will get mad at us at some point, probably :)

Thanks
   j

> >  			hsync-active = <0>;
> >  			vsync-active = <0>;
> > -			pclk-sample = <1>;
> >  			data-active = <1>;
> >  		};
> >  	};
> > @@ -895,7 +893,6 @@
> >
> >  		vin1ep0: endpoint {
> >  			remote-endpoint = <&adv7180>;
> > -			bus-width = <8>;
> >  		};
> >  	};
> >  };
> > diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
> > index f40321a..9967666 100644
> > --- a/arch/arm/boot/dts/r8a7791-koelsch.dts
> > +++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
> > @@ -849,10 +849,8 @@
> >
> >  		vin0ep2: endpoint {
> >  			remote-endpoint = <&adv7612_out>;
> > -			bus-width = <24>;
> >  			hsync-active = <0>;
> >  			vsync-active = <0>;
> > -			pclk-sample = <1>;
> >  			data-active = <1>;
> >  		};
> >  	};
> > @@ -870,7 +868,6 @@
> >
> >  		vin1ep: endpoint {
> >  			remote-endpoint = <&adv7180>;
> > -			bus-width = <8>;
> >  		};
> >  	};
> >  };
> > diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
> > index c14e6fe..055a7f1 100644
> > --- a/arch/arm/boot/dts/r8a7791-porter.dts
> > +++ b/arch/arm/boot/dts/r8a7791-porter.dts
> > @@ -391,7 +391,6 @@
> >
> >  		vin0ep: endpoint {
> >  			remote-endpoint = <&adv7180>;
> > -			bus-width = <8>;
> >  		};
> >  	};
> >  };
> > diff --git a/arch/arm/boot/dts/r8a7793-gose.dts b/arch/arm/boot/dts/r8a7793-gose.dts
> > index 9ed6961..9d3fba2 100644
> > --- a/arch/arm/boot/dts/r8a7793-gose.dts
> > +++ b/arch/arm/boot/dts/r8a7793-gose.dts
> > @@ -759,10 +759,8 @@
> >
> >  		vin0ep2: endpoint {
> >  			remote-endpoint = <&adv7612_out>;
> > -			bus-width = <24>;
> >  			hsync-active = <0>;
> >  			vsync-active = <0>;
> > -			pclk-sample = <1>;
> >  			data-active = <1>;
> >  		};
> >  	};
> > @@ -781,7 +779,6 @@
> >
> >  		vin1ep: endpoint {
> >  			remote-endpoint = <&adv7180_out>;
> > -			bus-width = <8>;
> >  		};
> >  	};
> >  };
> > diff --git a/arch/arm/boot/dts/r8a7794-alt.dts b/arch/arm/boot/dts/r8a7794-alt.dts
> > index 26a8834..4bbb9cc 100644
> > --- a/arch/arm/boot/dts/r8a7794-alt.dts
> > +++ b/arch/arm/boot/dts/r8a7794-alt.dts
> > @@ -380,7 +380,6 @@
> >
> >  		vin0ep: endpoint {
> >  			remote-endpoint = <&adv7180>;
> > -			bus-width = <8>;
> >  		};
> >  	};
> >  };
> > diff --git a/arch/arm/boot/dts/r8a7794-silk.dts b/arch/arm/boot/dts/r8a7794-silk.dts
> > index 351cb3b..c0c5d31 100644
> > --- a/arch/arm/boot/dts/r8a7794-silk.dts
> > +++ b/arch/arm/boot/dts/r8a7794-silk.dts
> > @@ -480,7 +480,6 @@
> >
> >  		vin0ep: endpoint {
> >  			remote-endpoint = <&adv7180>;
> > -			bus-width = <8>;
> >  		};
> >  	};
> >  };
> > --
> > 2.7.4
> >
>
> --
> Regards,
> Niklas S?derlund
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180517/c1578eef/attachment-0001.sig>

^ permalink raw reply

* [PATCH 2/2] [stable 4.4] arm64: Add work around for Arm Cortex-A55 Erratum 1024718
From: Greg KH @ 2018-05-17  9:01 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1526295664-22187-2-git-send-email-suzuki.poulose@arm.com>

On Mon, May 14, 2018 at 12:01:04PM +0100, Suzuki K Poulose wrote:
> commit ece1397cbc89c51914fae1aec729539cfd8bd62b upstream
> 
> Some variants of the Arm Cortex-55 cores (r0p0, r0p1, r1p0) suffer
> from an erratum 1024718, which causes incorrect updates when DBM/AP
> bits in a page table entry is modified without a break-before-make
> sequence. The work around is to disable the hardware DBM feature
> on the affected cores. The hardware Access Flag management features
> is not affected.
> 
> The hardware DBM feature is a non-conflicting capability, i.e, the
> kernel could handle cores using the feature and those without having
> the features running at the same time. So this work around is detected
> at early boot time, rather than delaying it until the CPUs are brought
> up into the kernel with MMU turned on. This also avoids other complexities
> with late CPUs turning online, with or without the hardware DBM features.
> 
> Cc: stable at vger.kernel.org # v4.4
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
> Note: The upstream commit is on top of a reworked capability
> infrastructure for arm64 heterogeneous systems, which allows
> delaying the CPU model checks. This backport is based on the
> original version of the patch [0], which checks the affected
> CPU models during the early boot.
> 
> [0] https://lkml.kernel.org/r/20180116102323.3470-1-suzuki.poulose at arm.com

Thanks for these, now queued up.

greg k-h

^ permalink raw reply

* [PATCH v2 3/3] arm64: dts: renesas: draak: Describe HDMI input
From: Simon Horman @ 2018-05-17  9:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180517071456.GT5956@w540>

On Thu, May 17, 2018 at 09:14:56AM +0200, jacopo mondi wrote:
> Hi Niklas,
> 
> On Thu, May 17, 2018 at 12:23:18AM +0200, Niklas S?derlund wrote:
> > Hi Jacopo,
> >
> > Thanks for your patch.
> >
> > On 2018-05-16 15:42:09 +0200, Jacopo Mondi wrote:
> > > Describe HDMI input connector and ADV7612 HDMI decoder installed on
> > > R-Car Gen3 Draak board.
> > >
> > > The video signal routing to the HDMI decoder to the video input interface
> > > VIN4 is multiplexed with CVBS input path, and enabled/disabled through
> > > on-board switches SW-49, SW-50, SW-51 and SW-52.
> > >
> > > As the default board switches configuration connects CVBS input to VIN4,
> > > leave the HDMI decoder unconnected in DTS.
> > >
> > > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> >
> > I'm not sure we have a policy about describing hardware which can't be
> > used without flipping switches. I have no opinion on if we should do
> > that or not I leave that to others, but for the change itself.
> >
> > Reviewed-by: Niklas S?derlund <niklas.soderlund+renesas@ragnatech.se>
> >
> 
> Thanks
> 
> > I think it's good we describe it as it's part of the Draak board itself
> > and not an expansion board which we have seen a lot of :-) Maybe even
> > add a commented out line in the adv7612 port at 2 which hints which VIN
> > this is connected to if the switches are flipped?
> 
> The only VIN instance that's on Draak, VIN4.
> 
> I can add a comment that describes the switch settings that enables
> the HDMI video capture path.

That sounds like a good plan to me.

^ permalink raw reply

* [PATCH 1/2] ARM: dts: Restructure Vexpress motherboard includes
From: Linus Walleij @ 2018-05-17  9:04 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <f8bf7e48-72ab-8749-5d23-32346475a440@arm.com>

On Wed, May 9, 2018 at 6:44 PM, Sudeep Holla <sudeep.holla@arm.com> wrote:

> Please copy me and Lorenzo also in future.
> Applied now(with typo in hierarchy fixed), thanks.

Sure thing, sorry I didn't realize you were working actively with
the Versatile Express, glad to see this :)

I will send you my Versatile Express transition to DRI/DRM series
today since my Pl111 work for Vexpress is now pending in linux-next,
if I can find the right commits to base it on, do you have
a Vexpress git branch somewhere?

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH 3/3] arm64: dts: renesas: r8a7795: add ccree binding
From: Simon Horman @ 2018-05-17  9:04 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAOtvUMfFjokOLCg6aHNQESJ_q4Jiok3izrPtae5wR+cND=XL6g@mail.gmail.com>

On Thu, May 17, 2018 at 11:01:57AM +0300, Gilad Ben-Yossef wrote:
> On Wed, May 16, 2018 at 10:43 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Tue, May 15, 2018 at 04:50:44PM +0200, Geert Uytterhoeven wrote:
> >> Hi Gilad,
> >>
> >> On Tue, May 15, 2018 at 2:29 PM, Gilad Ben-Yossef <gilad@benyossef.com> wrote:
> >> > Add bindings for CryptoCell instance in the SoC.
> >> >
> >> > Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
> >>
> >> Thanks for your patch!
> >>
> >> > --- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> >> > +++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
> >> > @@ -528,6 +528,14 @@
> >> >                         status = "disabled";
> >> >                 };
> >> >
> >> > +               arm_cc630p: crypto at e6601000 {
> >> > +                       compatible = "arm,cryptocell-630p-ree";
> >> > +                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
> >> > +                       #interrupt-cells = <2>;
> >>
> >> I believe the #interrupt-cells property is not needed.
> >>
> >> > +                       reg = <0x0 0xe6601000 0 0x1000>;
> >> > +                       clocks = <&cpg CPG_MOD 229>;
> >> > +               };
> >>
> >> The rest looks good, but I cannot verify the register block.
> >>
> >> > +
> >> >                 i2c3: i2c at e66d0000 {
> >> >                         #address-cells = <1>;
> >> >                         #size-cells = <0>;
> >
> > Thanks, I have applied this after dropping the #interrupt-cells property.
> 
> Thanks you!
> 
> Alas, it will not work without the clk patch (the previous one in the
> series) so they need to be
> taken or dropped together.

I think its fine if it does not yet work.
But not if its causes things that previously worked to stop working.

^ permalink raw reply

* [PATCH v2 0/3] input: touchscreen: edt-ft5x06: make wakeup source behavior configurable
From: Daniel Mack @ 2018-05-17  9:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

I have a platform that features an edt-ft5x06 touch panel and that
doesn't want to wake on touch screen activity.

Here's a trivial series of patches that make the edt-ft5x06 driver only
act as wakeup source when requested through device properties or DTS.

The third patch changes the default in two DTS files that use this
driver.

I guess the first two patches should go through the input tree, while
the third can be picked by the IMX people. There are no compile-time
dependencies, so the order doesn't matter.


Thanks,
Daniel

v1 ? v2:
	* simply drop device_init_wakeup() as the I2C core does handles
	  the wakeup-source property already (1/3)
	* add a delay after reset deassertion at resume time (2/3)
	* no changes in the DTS patch (3/3)


Daniel Mack (3):
  input: touchscreen: edt-ft5x06: don't make device a wakeup source by
    default
  input: touchscreen: edt-ft5x06: assert reset during suspend
  ARM: dts: imx28/imx53: enable edt-ft5x06 wakeup source

 .../bindings/input/touchscreen/edt-ft5x06.txt      |  3 +++
 arch/arm/boot/dts/imx28-tx28.dts                   |  1 +
 arch/arm/boot/dts/imx53-tx53-x03x.dts              |  1 +
 drivers/input/touchscreen/edt-ft5x06.c             | 27 +++++++++++++++++-----
 4 files changed, 26 insertions(+), 6 deletions(-)

-- 
2.14.3

^ permalink raw reply

* [PATCH v2 1/3] input: touchscreen: edt-ft5x06: don't make device a wakeup source by default
From: Daniel Mack @ 2018-05-17  9:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180517090552.5704-1-daniel@zonque.org>

Allow configuring the device as wakeup source through device properties, as
not all platforms want to wake up on touch screen activity.

The I2C core automatically reads the "wakeup-source" DT property to
configure a device's wakeup capability, and board supports files can set
I2C_CLIENT_WAKE in the flags.

Signed-off-by: Daniel Mack <daniel@zonque.org>
---
 Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt | 3 +++
 drivers/input/touchscreen/edt-ft5x06.c                             | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
index 025cf8c9324a..83f792d4d88c 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
@@ -52,6 +52,8 @@ Optional properties:
  - touchscreen-inverted-y  : See touchscreen.txt
  - touchscreen-swapped-x-y : See touchscreen.txt
 
+ - wakeup-source: touchscreen acts as wakeup source
+
 Example:
 	polytouch: edt-ft5x06 at 38 {
 		compatible = "edt,edt-ft5406", "edt,edt-ft5x06";
@@ -62,4 +64,5 @@ Example:
 		interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
 		reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
 		wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>;
+		wakeup-source;
 	};
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 5bf63f76ddda..e18a2f215500 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -1007,7 +1007,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 		goto err_remove_attrs;
 
 	edt_ft5x06_ts_prepare_debugfs(tsdata, dev_driver_string(&client->dev));
-	device_init_wakeup(&client->dev, 1);
 
 	dev_dbg(&client->dev,
 		"EDT FT5x06 initialized: IRQ %d, WAKE pin %d, Reset pin %d.\n",
-- 
2.14.3

^ permalink raw reply related

* [PATCH v2 2/3] input: touchscreen: edt-ft5x06: assert reset during suspend
From: Daniel Mack @ 2018-05-17  9:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180517090552.5704-1-daniel@zonque.org>

If the device is not configured as wakeup source, it can be put in reset
during suspend to save some power.

Signed-off-by: Daniel Mack <daniel@zonque.org>
---
 drivers/input/touchscreen/edt-ft5x06.c | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index e18a2f215500..145499022e1c 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -883,6 +883,20 @@ edt_ft5x06_ts_set_regs(struct edt_ft5x06_ts_data *tsdata)
 	}
 }
 
+static void edt_ft5x06_reset(struct edt_ft5x06_ts_data *tsdata, bool reset)
+{
+	if (!tsdata->reset_gpio)
+		return;
+
+	if (reset) {
+		gpiod_set_value_cansleep(tsdata->reset_gpio, 1);
+	} else {
+		usleep_range(5000, 6000);
+		gpiod_set_value_cansleep(tsdata->reset_gpio, 0);
+		msleep(300);
+	}
+}
+
 static int edt_ft5x06_ts_probe(struct i2c_client *client,
 					 const struct i2c_device_id *id)
 {
@@ -934,11 +948,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 		gpiod_set_value_cansleep(tsdata->wake_gpio, 1);
 	}
 
-	if (tsdata->reset_gpio) {
-		usleep_range(5000, 6000);
-		gpiod_set_value_cansleep(tsdata->reset_gpio, 0);
-		msleep(300);
-	}
+	edt_ft5x06_reset(tsdata, false);
 
 	input = devm_input_allocate_device(&client->dev);
 	if (!input) {
@@ -1034,9 +1044,12 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client)
 static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
+	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
 
 	if (device_may_wakeup(dev))
 		enable_irq_wake(client->irq);
+	else
+		edt_ft5x06_reset(tsdata, true);
 
 	return 0;
 }
@@ -1044,9 +1057,12 @@ static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev)
 static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
+	struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
 
 	if (device_may_wakeup(dev))
 		disable_irq_wake(client->irq);
+	else
+		edt_ft5x06_reset(tsdata, false);
 
 	return 0;
 }
-- 
2.14.3

^ permalink raw reply related

* [PATCH v2 3/3] ARM: dts: imx28/imx53: enable edt-ft5x06 wakeup source
From: Daniel Mack @ 2018-05-17  9:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180517090552.5704-1-daniel@zonque.org>

The touchscreen driver no longer configures the device as wakeup source by
default. A "wakeup-source" property is needed.

To avoid regressions, this patch changes the DTS files for the only two
users of this driver that didn't have this property yet.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Rob Herring <robh+dt@kernel.org>
---
 arch/arm/boot/dts/imx28-tx28.dts      | 1 +
 arch/arm/boot/dts/imx53-tx53-x03x.dts | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index 0ebbc83852d0..094a39a67ec8 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -328,6 +328,7 @@
 		interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
 		reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
 		wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>;
+		wakeup-source;
 	};
 
 	touchscreen: tsc2007 at 48 {
diff --git a/arch/arm/boot/dts/imx53-tx53-x03x.dts b/arch/arm/boot/dts/imx53-tx53-x03x.dts
index 0ecb43d88522..dbf0d73dc7b9 100644
--- a/arch/arm/boot/dts/imx53-tx53-x03x.dts
+++ b/arch/arm/boot/dts/imx53-tx53-x03x.dts
@@ -220,6 +220,7 @@
 		interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
 		reset-gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
 		wake-gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
+		wakeup-source;
 	};
 
 	touchscreen: tsc2007 at 48 {
-- 
2.14.3

^ permalink raw reply related

* [PATCH v9 02/12] drivers: base: cacheinfo: setup DT cache properties early
From: Sudeep Holla @ 2018-05-17  9:08 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20180517065449.GA13589@kroah.com>

Hi Greg,

On 17/05/18 07:54, Greg KH wrote:
> On Tue, May 15, 2018 at 12:15:08PM -0500, Jeremy Linton wrote:
>> Hi Greg,
>>
>> Have you had a chance to look at the cachinfo parts of this patch?
> 
> Nope :)
> 
> I didn't write that, and while it is dumped in the driver core section
> of the kernel, I know nothing about it. 

Sorry for that, I didn't find any better place at that time(neither
now), so I did put it there following topology :)

> If you get an ack from Sudeep for this, which you did, that's fine
> with me, merge away!
> 

Thanks, we plan to take it via ARM64, hence we needed your official
say(ACK) for that.

-- 
Regards,
Sudeep

^ permalink raw reply

* [PATCH 7/8] firmware: arm_scmi: improve exit paths and code readability
From: Jonathan Cameron @ 2018-05-17  9:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1525885634-22348-8-git-send-email-sudeep.holla@arm.com>

On Wed, 9 May 2018 18:07:13 +0100
Sudeep Holla <sudeep.holla@arm.com> wrote:

> The existing code intends the good path to reduce the code which is so
> uncommon. It's obvious to have more readable code with a goto used for
> the error path. This patch adds more appropriate error paths and makes
> code more readable. It also moves a error logging outside the scope of
> locking.
> 
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

It could be argued the lock move is unrelated and should be in a separate
patch... Not particularly important though.

Some comments inline, but I'm happy with how you did this.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/firmware/arm_scmi/bus.c | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index f2760a596c28..472c88ae1c0f 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -125,13 +125,13 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol)
>  	int id, retval;
>  	struct scmi_device *scmi_dev;
>  
> -	id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL);
> -	if (id < 0)
> -		return NULL;
> -
>  	scmi_dev = kzalloc(sizeof(*scmi_dev), GFP_KERNEL);
>  	if (!scmi_dev)
> -		goto no_mem;
> +		return NULL;
> +
> +	id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL);
> +	if (id < 0)
> +		goto free_mem;

I guess this reorder was to match what is done in remove?

Personally I would have reordered remove as that was a one line change, but
it really doesn't matter.

>  
>  	scmi_dev->id = id;
>  	scmi_dev->protocol_id = protocol;
> @@ -141,13 +141,15 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol)
>  	dev_set_name(&scmi_dev->dev, "scmi_dev.%d", id);
>  
>  	retval = device_register(&scmi_dev->dev);
> -	if (!retval)
> -		return scmi_dev;
> +	if (retval)
> +		goto put_dev;
>  
> +	return scmi_dev;

If you are respinning I'd add a blank line here for readability.

> +put_dev:
>  	put_device(&scmi_dev->dev);
> -	kfree(scmi_dev);
> -no_mem:
>  	ida_simple_remove(&scmi_bus_id, id);
> +free_mem:
> +	kfree(scmi_dev);
>  	return NULL;
>  }
>  
> @@ -171,9 +173,9 @@ int scmi_protocol_register(int protocol_id, scmi_prot_init_fn_t fn)
>  	spin_lock(&protocol_lock);
>  	ret = idr_alloc(&scmi_protocols, fn, protocol_id, protocol_id + 1,
>  			GFP_ATOMIC);
> +	spin_unlock(&protocol_lock);
>  	if (ret != protocol_id)
>  		pr_err("unable to allocate SCMI idr slot, err %d\n", ret);
> -	spin_unlock(&protocol_lock);
>  
>  	return ret;
>  }

^ permalink raw reply

* [PATCH 8/8] firmware: arm_scmi: simplify exit path by returning on error
From: Jonathan Cameron @ 2018-05-17  9:14 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1525885634-22348-9-git-send-email-sudeep.holla@arm.com>

On Wed, 9 May 2018 18:07:14 +0100
Sudeep Holla <sudeep.holla@arm.com> wrote:

> Yet another nasty indentation left out during code restructuring. It's
> must simpler to return on error instead of having unnecessary indentation.
> 
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


> ---
>  drivers/firmware/arm_scmi/driver.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 4087d6c50ecd..e996395af5f2 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -687,11 +687,12 @@ static int scmi_remove(struct platform_device *pdev)
>  		list_del(&info->node);
>  	mutex_unlock(&scmi_list_mutex);
>  
> -	if (!ret) {
> -		/* Safe to free channels since no more users */
> -		ret = idr_for_each(idr, scmi_mbox_free_channel, idr);
> -		idr_destroy(&info->tx_idr);
> -	}
> +	if (ret)
> +		return ret;
> +
> +	/* Safe to free channels since no more users */
> +	ret = idr_for_each(idr, scmi_mbox_free_channel, idr);
> +	idr_destroy(&info->tx_idr);
>  
>  	return ret;
>  }

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox