Skip to content

Commit

Permalink
Revert "soundwire: mipi_disco: read lane mapping properties from ACPI"
Browse files Browse the repository at this point in the history
This reverts commit f4fa7f1.
  • Loading branch information
bardliao committed Sep 11, 2024
1 parent e9eaeac commit 46d9f99
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 44 deletions.
40 changes: 1 addition & 39 deletions drivers/soundwire/mipi_disco.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,44 +366,6 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave,
return 0;
}

/*
* In MIPI DisCo spec for SoundWire, lane mapping for a slave device is done with
* mipi-sdw-lane-x-mapping properties, where x is 1..7, and the values for those
* properties are mipi-sdw-manager-lane-x or mipi-sdw-peripheral-link-y, where x
* is an integer between 1 to 7 if the lane is connected to a manager lane, y is a
* character between A to E if the lane is connected to another peripheral lane.
*/
int sdw_slave_read_lane_mapping(struct sdw_slave *slave)
{
struct sdw_slave_prop *prop = &slave->prop;
struct device *dev = &slave->dev;
char prop_name[30];
const char *prop_val;
size_t len;
int ret, i;
u8 lane;

for (i = 0; i < SDW_MAX_LANES; i++) {
snprintf(prop_name, sizeof(prop_name), "mipi-sdw-lane-%d-mapping", i);
ret = device_property_read_string(dev, prop_name, &prop_val);
if (ret)
continue;

len = strlen(prop_val);
if (len < 1)
return -EINVAL;

/* The last character is enough to identify the connection */
ret = kstrtou8(&prop_val[len - 1], 10, &lane);
if (ret)
return ret;
if (in_range(lane, 1, SDW_MAX_LANES - 1))
prop->lane_maps[i] = lane;
}
return 0;
}
EXPORT_SYMBOL(sdw_slave_read_lane_mapping);

/**
* sdw_slave_read_prop() - Read Slave properties
* @slave: SDW Slave
Expand Down Expand Up @@ -531,6 +493,6 @@ int sdw_slave_read_prop(struct sdw_slave *slave)
sdw_slave_read_dpn(slave, prop->sink_dpn_prop, nval,
prop->sink_ports, "sink");

return sdw_slave_read_lane_mapping(slave);
return 0;
}
EXPORT_SYMBOL(sdw_slave_read_prop);
5 changes: 0 additions & 5 deletions include/linux/soundwire/sdw.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ struct sdw_slave;
#define SDW_MAX_PORTS 15
#define SDW_VALID_PORT_RANGE(n) ((n) < SDW_MAX_PORTS && (n) >= 1)

#define SDW_MAX_LANES 8

enum {
SDW_PORT_DIRN_SINK = 0,
SDW_PORT_DIRN_SOURCE,
Expand Down Expand Up @@ -350,7 +348,6 @@ struct sdw_dpn_prop {
* and masks are supported
* @commit_register_supported: is PCP_Commit register supported
* @scp_int1_mask: SCP_INT1_MASK desired settings
* @lane_maps: Lane mapping for the slave, only valid if lane_control_support is set
* @clock_reg_supported: the Peripheral implements the clock base and scale
* registers introduced with the SoundWire 1.2 specification. SDCA devices
* do not need to set this boolean property as the registers are required.
Expand Down Expand Up @@ -380,7 +377,6 @@ struct sdw_slave_prop {
u32 sdca_interrupt_register_list;
u8 commit_register_supported;
u8 scp_int1_mask;
u8 lane_maps[SDW_MAX_LANES];
bool clock_reg_supported;
bool use_domain_irq;
};
Expand Down Expand Up @@ -446,7 +442,6 @@ struct sdw_master_prop {

int sdw_master_read_prop(struct sdw_bus *bus);
int sdw_slave_read_prop(struct sdw_slave *slave);
int sdw_slave_read_lane_mapping(struct sdw_slave *slave);

/*
* SDW Slave Structures and APIs
Expand Down

0 comments on commit 46d9f99

Please sign in to comment.