Skip to content

Commit 1c758df

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: optimize sdw_slave_prop
move pointers first, and move booleans together. before: struct sdw_slave_prop { u32 mipi_revision; /* 0 4 */ bool wake_capable; /* 4 1 */ bool test_mode_capable; /* 5 1 */ bool clk_stop_mode1; /* 6 1 */ bool simple_clk_stop_capable; /* 7 1 */ u32 clk_stop_timeout; /* 8 4 */ u32 ch_prep_timeout; /* 12 4 */ enum sdw_clk_stop_reset_behave reset_behave; /* 16 4 */ bool high_PHY_capable; /* 20 1 */ bool paging_support; /* 21 1 */ bool bank_delay_support; /* 22 1 */ /* XXX 1 byte hole, try to pack */ enum sdw_p15_behave p15_behave; /* 24 4 */ bool lane_control_support; /* 28 1 */ /* XXX 3 bytes hole, try to pack */ u32 master_count; /* 32 4 */ u32 source_ports; /* 36 4 */ u32 sink_ports; /* 40 4 */ /* XXX 4 bytes hole, try to pack */ struct sdw_dp0_prop * dp0_prop; /* 48 8 */ struct sdw_dpn_prop * src_dpn_prop; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct sdw_dpn_prop * sink_dpn_prop; /* 64 8 */ u8 scp_int1_mask; /* 72 1 */ /* XXX 3 bytes hole, try to pack */ u32 quirks; /* 76 4 */ bool clock_reg_supported; /* 80 1 */ bool use_domain_irq; /* 81 1 */ /* size: 88, cachelines: 2, members: 23 */ /* sum members: 71, holes: 4, sum holes: 11 */ /* padding: 6 */ /* last cacheline: 24 bytes */ }; after: truct sdw_slave_prop { struct sdw_dp0_prop * dp0_prop; /* 0 8 */ struct sdw_dpn_prop * src_dpn_prop; /* 8 8 */ struct sdw_dpn_prop * sink_dpn_prop; /* 16 8 */ u32 mipi_revision; /* 24 4 */ bool wake_capable; /* 28 1 */ bool test_mode_capable; /* 29 1 */ bool clk_stop_mode1; /* 30 1 */ bool simple_clk_stop_capable; /* 31 1 */ u32 clk_stop_timeout; /* 32 4 */ u32 ch_prep_timeout; /* 36 4 */ enum sdw_clk_stop_reset_behave reset_behave; /* 40 4 */ bool high_PHY_capable; /* 44 1 */ bool paging_support; /* 45 1 */ bool bank_delay_support; /* 46 1 */ bool lane_control_support; /* 47 1 */ enum sdw_p15_behave p15_behave; /* 48 4 */ u32 master_count; /* 52 4 */ u32 source_ports; /* 56 4 */ u32 sink_ports; /* 60 4 */ /* --- cacheline 1 boundary (64 bytes) --- */ u32 quirks; /* 64 4 */ u8 scp_int1_mask; /* 68 1 */ bool clock_reg_supported; /* 69 1 */ bool use_domain_irq; /* 70 1 */ /* size: 72, cachelines: 2, members: 23 */ /* padding: 1 */ /* last cacheline: 8 bytes */ }; Signed-off-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 0a323da commit 1c758df

File tree

1 file changed

+9
-9
lines changed
  • include/linux/soundwire

1 file changed

+9
-9
lines changed

include/linux/soundwire/sdw.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ struct sdw_dpn_prop {
344344

345345
/**
346346
* struct sdw_slave_prop - SoundWire Slave properties
347+
* @dp0_prop: Data Port 0 properties
348+
* @src_dpn_prop: Source Data Port N properties
349+
* @sink_dpn_prop: Sink Data Port N properties
347350
* @mipi_revision: Spec version of the implementation
348351
* @wake_capable: Wake-up events are supported
349352
* @test_mode_capable: If test mode is supported
@@ -360,15 +363,12 @@ struct sdw_dpn_prop {
360363
* SCP_AddrPage2
361364
* @bank_delay_support: Slave implements bank delay/bridge support registers
362365
* SCP_BankDelay and SCP_NextFrame
366+
* @lane_control_support: Slave supports lane control
363367
* @p15_behave: Slave behavior when the Master attempts a read to the Port15
364368
* alias
365-
* @lane_control_support: Slave supports lane control
366369
* @master_count: Number of Masters present on this Slave
367370
* @source_ports: Bitmap identifying source ports
368371
* @sink_ports: Bitmap identifying sink ports
369-
* @dp0_prop: Data Port 0 properties
370-
* @src_dpn_prop: Source Data Port N properties
371-
* @sink_dpn_prop: Sink Data Port N properties
372372
* @scp_int1_mask: SCP_INT1_MASK desired settings
373373
* @quirks: bitmask identifying deltas from the MIPI specification
374374
* @clock_reg_supported: the Peripheral implements the clock base and scale
@@ -377,6 +377,9 @@ struct sdw_dpn_prop {
377377
* @use_domain_irq: call actual IRQ handler on slave, as well as callback
378378
*/
379379
struct sdw_slave_prop {
380+
struct sdw_dp0_prop *dp0_prop;
381+
struct sdw_dpn_prop *src_dpn_prop;
382+
struct sdw_dpn_prop *sink_dpn_prop;
380383
u32 mipi_revision;
381384
bool wake_capable;
382385
bool test_mode_capable;
@@ -388,16 +391,13 @@ struct sdw_slave_prop {
388391
bool high_PHY_capable;
389392
bool paging_support;
390393
bool bank_delay_support;
391-
enum sdw_p15_behave p15_behave;
392394
bool lane_control_support;
395+
enum sdw_p15_behave p15_behave;
393396
u32 master_count;
394397
u32 source_ports;
395398
u32 sink_ports;
396-
struct sdw_dp0_prop *dp0_prop;
397-
struct sdw_dpn_prop *src_dpn_prop;
398-
struct sdw_dpn_prop *sink_dpn_prop;
399-
u8 scp_int1_mask;
400399
u32 quirks;
400+
u8 scp_int1_mask;
401401
bool clock_reg_supported;
402402
bool use_domain_irq;
403403
};

0 commit comments

Comments
 (0)