@@ -1633,11 +1633,8 @@ pub const Pinctrl = struct {
16331633 /// Device Tree node for the pinctrl device
16341634 device : * dtb.Node ,
16351635 device_res : ConfigResources.Device ,
1636- /// Client PDs serviced by the pinctrl driver
1637- clients : std .ArrayList (* Pd ),
1638- client_configs : std .ArrayList (ConfigResources .Pinctrl .Client ),
1639- connected : bool = false ,
16401636 serialised : bool = false ,
1637+ connected : bool = false ,
16411638
16421639 pub const Error = SystemError ;
16431640
@@ -1652,53 +1649,20 @@ pub const Pinctrl = struct {
16521649 .driver = driver ,
16531650 .device = device ,
16541651 .device_res = std .mem .zeroInit (ConfigResources .Device , .{}),
1655- .clients = std .ArrayList (* Pd ).init (allocator ),
1656- .client_configs = std .ArrayList (ConfigResources .Pinctrl .Client ).init (allocator ),
16571652 };
16581653 }
16591654
16601655 pub fn deinit (system : * Pinctrl ) void {
1661- system .clients .deinit ();
1662- system .client_configs .deinit ();
1663- }
1664-
1665- pub fn addClient (system : * Pinctrl , client : * Pd ) Error ! void {
1666- // Check that the client does not already exist
1667- for (system .clients .items ) | existing_client | {
1668- if (std .mem .eql (u8 , existing_client .name , client .name )) {
1669- return Error .DuplicateClient ;
1670- }
1671- }
1672- if (std .mem .eql (u8 , client .name , system .driver .name )) {
1673- log .err ("invalid pinctrl client, same name as driver '{s}" , .{client .name });
1674- return Error .InvalidClient ;
1675- }
1676- const client_priority = if (client .priority ) | priority | priority else Pd .DEFAULT_PRIORITY ;
1677- const driver_priority = if (system .driver .priority ) | priority | priority else Pd .DEFAULT_PRIORITY ;
1678- if (client_priority >= driver_priority ) {
1679- log .err ("invalid pinctrl client '{s}', driver '{s}' must have greater priority than client" , .{ client .name , system .driver .name });
1680- return Error .InvalidClient ;
1681- }
1682- system .clients .append (client ) catch @panic ("Could not add client to Pinctrl" );
1683- system .client_configs .append (std .mem .zeroInit (ConfigResources .Pinctrl .Client , .{})) catch @panic ("Could not add client to Timer" );
1656+ // In the future when we add clients we would need to free associated resources here
1657+ _ = system ;
1658+ return ;
16841659 }
16851660
16861661 pub fn connect (system : * Pinctrl ) ! void {
16871662 // The driver must be passive
16881663 assert (system .driver .passive .? );
16891664
16901665 try createDriver (system .sdf , system .driver , system .device , .pinctrl , & system .device_res );
1691- for (system .clients .items , 0.. ) | client , i | {
1692- const ch = Channel .create (system .driver , client , .{
1693- // Client needs to be able to PPC into driver
1694- .pp = .b ,
1695- // Client does not need to notify driver
1696- .pd_b_notify = false ,
1697- }) catch unreachable ;
1698- system .sdf .addChannel (ch );
1699- system .client_configs .items [i ].driver_id = ch .pd_b_id ;
1700- }
1701-
17021666 system .connected = true ;
17031667 }
17041668
@@ -1710,11 +1674,6 @@ pub const Pinctrl = struct {
17101674 const device_res_data_name = fmt (allocator , "{s}_device_resources" , .{system .driver .name });
17111675 try data .serialize (allocator , system .device_res , prefix , device_res_data_name );
17121676
1713- for (system .clients .items , 0.. ) | client , i | {
1714- const data_name = fmt (allocator , "pinctrl_client_{s}" , .{client .name });
1715- try data .serialize (allocator , system .client_configs .items [i ], prefix , data_name );
1716- }
1717-
17181677 system .serialised = true ;
17191678 }
17201679};
0 commit comments