]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SDCA: Parse XU Entity properties
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 20 Oct 2025 15:55:03 +0000 (16:55 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 27 Oct 2025 15:31:20 +0000 (15:31 +0000)
Parse the DisCo properties for XU Entities.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20251020155512.353774-11-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/sdca_function.h
sound/soc/sdca/sdca_functions.c

index ab9af84082c95eb70cf15070e1e205c531b96bcb..f2ce13162151d2a3fab0cd7eee0915c7dca21a79 100644 (file)
@@ -1090,6 +1090,27 @@ struct sdca_entity_hide {
        struct hid_descriptor hid_desc;
 };
 
+/**
+ * enum sdca_xu_reset_machanism - SDCA FDL Resets
+ */
+enum sdca_xu_reset_mechanism {
+       SDCA_XU_RESET_FUNCTION                          = 0x0,
+       SDCA_XU_RESET_DEVICE                            = 0x1,
+       SDCA_XU_RESET_BUS                               = 0x2,
+};
+
+/**
+ * struct sdca_entity_xu - information specific to XU Entities
+ * @max_delay: the maximum time in microseconds allowed for the Device
+ * to change the ownership from Device to Host
+ * @reset_mechanism: indicates the type of reset that can be requested
+ * the end of an FDL.
+ */
+struct sdca_entity_xu {
+       unsigned int max_delay;
+       enum sdca_xu_reset_mechanism reset_mechanism;
+};
+
 /**
  * struct sdca_entity - information for one SDCA Entity
  * @label: String such as "OT 12".
@@ -1106,6 +1127,7 @@ struct sdca_entity_hide {
  * @pde: Power Domain Entity specific Entity properties.
  * @ge: Group Entity specific Entity properties.
  * @hide: HIDE Entity specific Entity properties.
+ * @xu: XU Entity specific Entity properties.
  */
 struct sdca_entity {
        const char *label;
@@ -1123,6 +1145,7 @@ struct sdca_entity {
                struct sdca_entity_pde pde;
                struct sdca_entity_ge ge;
                struct sdca_entity_hide hide;
+               struct sdca_entity_xu xu;
        };
 };
 
index 3e1df30f5d609346305cf35c1106cefc03518ece..2e667484622137db33af435c59da5fda93b06410 100644 (file)
@@ -1398,6 +1398,28 @@ find_sdca_entity_hide(struct device *dev, struct sdw_slave *sdw,
        return 0;
 }
 
+static int find_sdca_entity_xu(struct device *dev,
+                              struct fwnode_handle *entity_node,
+                              struct sdca_entity *entity)
+{
+       struct sdca_entity_xu *xu = &entity->xu;
+       u32 tmp;
+       int ret;
+
+       ret = fwnode_property_read_u32(entity_node,
+                                      "mipi-sdca-RxUMP-ownership-transition-max-delay",
+                                      &tmp);
+       if (!ret)
+               xu->max_delay = tmp;
+
+       ret = fwnode_property_read_u32(entity_node, "mipi-sdca-FDL-reset-mechanism",
+                                      &tmp);
+       if (!ret)
+               xu->reset_mechanism = tmp;
+
+       return 0;
+}
+
 static int find_sdca_entity(struct device *dev, struct sdw_slave *sdw,
                            struct fwnode_handle *function_node,
                            struct fwnode_handle *entity_node,
@@ -1430,6 +1452,9 @@ static int find_sdca_entity(struct device *dev, struct sdw_slave *sdw,
        case SDCA_ENTITY_TYPE_OT:
                ret = find_sdca_entity_iot(dev, entity_node, entity);
                break;
+       case SDCA_ENTITY_TYPE_XU:
+               ret = find_sdca_entity_xu(dev, entity_node, entity);
+               break;
        case SDCA_ENTITY_TYPE_CS:
                ret = find_sdca_entity_cs(dev, entity_node, entity);
                break;