-/* $OpenBSD: rkpinctrl.c,v 1.11 2023/03/04 22:51:12 kettenis Exp $ */
+/* $OpenBSD: rkpinctrl.c,v 1.12 2023/06/19 13:37:22 kettenis Exp $ */
/*
* Copyright (c) 2017, 2018 Mark Kettenis <kettenis@openbsd.org>
*
bank = pins[i];
idx = pins[i + 1];
mux = pins[i + 2];
- pull = rk3568_pull(bank, idx, pins[i + 3]);
- strength = rk3568_strength(bank, idx, pins[i + 3]);
- schmitt = rk3568_schmitt(bank, idx, pins[i + 3]);
+ pull = rk3588_pull(bank, idx, pins[i + 3]);
+ strength = rk3588_strength(bank, idx, pins[i + 3]);
+ schmitt = rk3588_schmitt(bank, idx, pins[i + 3]);
if (bank > 5 || idx > 32 || mux > 15)
continue;
if (strength >= 0) {
off = bank * 0x20 + (idx / 4) * 0x04;
mask = (0xf << ((idx % 4) * 4));
- bits = ((1 << (strength + 1)) - 1) << ((idx % 4) * 4);
+ bits = (strength << ((idx % 4) * 4));
regmap_write_4(rm, ds_base + off, mask << 16 | bits);
}
if (schmitt >= 0) {
off = bank * 0x10 + (idx / 8) * 0x04;
mask = (0x1 << (idx % 8));
- bits = schmitt << (idx % 8);
+ bits = (schmitt << (idx % 8));
regmap_write_4(rm, smt_base + off, mask << 16 | bits);
}