@@ -1645,11 +1645,8 @@ pub const Pinctrl = struct {
1645
1645
/// Device Tree node for the pinctrl device
1646
1646
device : * dtb.Node ,
1647
1647
device_res : ConfigResources.Device ,
1648
- /// Client PDs serviced by the pinctrl driver
1649
- clients : std .ArrayList (* Pd ),
1650
- client_configs : std .ArrayList (ConfigResources .Pinctrl .Client ),
1651
- connected : bool = false ,
1652
1648
serialised : bool = false ,
1649
+ connected : bool = false ,
1653
1650
1654
1651
pub const Error = SystemError ;
1655
1652
@@ -1664,53 +1661,20 @@ pub const Pinctrl = struct {
1664
1661
.driver = driver ,
1665
1662
.device = device ,
1666
1663
.device_res = std .mem .zeroInit (ConfigResources .Device , .{}),
1667
- .clients = std .ArrayList (* Pd ).init (allocator ),
1668
- .client_configs = std .ArrayList (ConfigResources .Pinctrl .Client ).init (allocator ),
1669
1664
};
1670
1665
}
1671
1666
1672
1667
pub fn deinit (system : * Pinctrl ) void {
1673
- system .clients .deinit ();
1674
- system .client_configs .deinit ();
1675
- }
1676
-
1677
- pub fn addClient (system : * Pinctrl , client : * Pd ) Error ! void {
1678
- // Check that the client does not already exist
1679
- for (system .clients .items ) | existing_client | {
1680
- if (std .mem .eql (u8 , existing_client .name , client .name )) {
1681
- return Error .DuplicateClient ;
1682
- }
1683
- }
1684
- if (std .mem .eql (u8 , client .name , system .driver .name )) {
1685
- log .err ("invalid pinctrl client, same name as driver '{s}" , .{client .name });
1686
- return Error .InvalidClient ;
1687
- }
1688
- const client_priority = if (client .priority ) | priority | priority else Pd .DEFAULT_PRIORITY ;
1689
- const driver_priority = if (system .driver .priority ) | priority | priority else Pd .DEFAULT_PRIORITY ;
1690
- if (client_priority >= driver_priority ) {
1691
- log .err ("invalid pinctrl client '{s}', driver '{s}' must have greater priority than client" , .{ client .name , system .driver .name });
1692
- return Error .InvalidClient ;
1693
- }
1694
- system .clients .append (client ) catch @panic ("Could not add client to Pinctrl" );
1695
- system .client_configs .append (std .mem .zeroInit (ConfigResources .Pinctrl .Client , .{})) catch @panic ("Could not add client to Timer" );
1668
+ // In the future when we add clients we would need to free associated resources here
1669
+ _ = system ;
1670
+ return ;
1696
1671
}
1697
1672
1698
1673
pub fn connect (system : * Pinctrl ) ! void {
1699
1674
// The driver must be passive
1700
1675
assert (system .driver .passive .? );
1701
1676
1702
1677
try createDriver (system .sdf , system .driver , system .device , .pinctrl , & system .device_res );
1703
- for (system .clients .items , 0.. ) | client , i | {
1704
- const ch = Channel .create (system .driver , client , .{
1705
- // Client needs to be able to PPC into driver
1706
- .pp = .b ,
1707
- // Client does not need to notify driver
1708
- .pd_b_notify = false ,
1709
- }) catch unreachable ;
1710
- system .sdf .addChannel (ch );
1711
- system .client_configs .items [i ].driver_id = ch .pd_b_id ;
1712
- }
1713
-
1714
1678
system .connected = true ;
1715
1679
}
1716
1680
@@ -1722,11 +1686,6 @@ pub const Pinctrl = struct {
1722
1686
const device_res_data_name = fmt (allocator , "{s}_device_resources" , .{system .driver .name });
1723
1687
try data .serialize (allocator , system .device_res , prefix , device_res_data_name );
1724
1688
1725
- for (system .clients .items , 0.. ) | client , i | {
1726
- const data_name = fmt (allocator , "pinctrl_client_{s}" , .{client .name });
1727
- try data .serialize (allocator , system .client_configs .items [i ], prefix , data_name );
1728
- }
1729
-
1730
1689
system .serialised = true ;
1731
1690
}
1732
1691
};
0 commit comments