Lines Matching +full:sda +full:- +full:pullup +full:- +full:ohms

1 // SPDX-License-Identifier: GPL-2.0
14 #include "dw-i3c-master.h"
16 /* AST2600-specific global register set */
53 static int ast2600_i3c_pullup_to_reg(unsigned int ohms, u32 *regp) in ast2600_i3c_pullup_to_reg() argument
57 switch (ohms) { in ast2600_i3c_pullup_to_reg()
68 return -EINVAL; in ast2600_i3c_pullup_to_reg()
83 /* reg0: set SDA pullup values */ in ast2600_i3c_init()
84 rc = ast2600_i3c_pullup_to_reg(i3c->sda_pullup, &reg); in ast2600_i3c_init()
88 rc = regmap_write(i3c->global_regs, in ast2600_i3c_init()
89 AST2600_I3CG_REG0(i3c->global_idx), reg); in ast2600_i3c_init()
96 reg = AST2600_I3CG_REG1_INST_ID(i3c->global_idx); in ast2600_i3c_init()
97 rc = regmap_write(i3c->global_regs, in ast2600_i3c_init()
98 AST2600_I3CG_REG1(i3c->global_idx), reg); in ast2600_i3c_init()
108 * The ast2600 i3c controller will lock up on receiving 4n+1-byte IBIs in ast2600_i3c_set_dat_ibi()
113 if (enable && dev->info.bcr & I3C_BCR_IBI_PAYLOAD) { in ast2600_i3c_set_dat_ibi()
114 dev_warn_once(&i3c->base.dev, in ast2600_i3c_set_dat_ibi()
127 struct device_node *np = pdev->dev.of_node; in ast2600_i3c_probe()
132 i3c = devm_kzalloc(&pdev->dev, sizeof(*i3c), GFP_KERNEL); in ast2600_i3c_probe()
134 return -ENOMEM; in ast2600_i3c_probe()
136 rc = of_parse_phandle_with_fixed_args(np, "aspeed,global-regs", 1, 0, in ast2600_i3c_probe()
139 return -ENODEV; in ast2600_i3c_probe()
141 i3c->global_regs = syscon_node_to_regmap(gspec.np); in ast2600_i3c_probe()
144 if (IS_ERR(i3c->global_regs)) in ast2600_i3c_probe()
145 return PTR_ERR(i3c->global_regs); in ast2600_i3c_probe()
147 i3c->global_idx = gspec.args[0]; in ast2600_i3c_probe()
149 rc = of_property_read_u32(np, "sda-pullup-ohms", &i3c->sda_pullup); in ast2600_i3c_probe()
151 i3c->sda_pullup = AST2600_DEFAULT_SDA_PULLUP_OHMS; in ast2600_i3c_probe()
153 rc = ast2600_i3c_pullup_to_reg(i3c->sda_pullup, NULL); in ast2600_i3c_probe()
155 dev_err(&pdev->dev, "invalid sda-pullup value %d\n", in ast2600_i3c_probe()
156 i3c->sda_pullup); in ast2600_i3c_probe()
158 i3c->dw.platform_ops = &ast2600_i3c_ops; in ast2600_i3c_probe()
159 i3c->dw.ibi_capable = true; in ast2600_i3c_probe()
160 return dw_i3c_common_probe(&i3c->dw, pdev); in ast2600_i3c_probe()
171 { .compatible = "aspeed,ast2600-i3c", },
180 .name = "ast2600-i3c-master",