[mt8167][gpio] Fix MMIO test methods Test: mt8167 ref board boots. Tets: runtests -t mtk-gpio-test Change-Id: I8c18380558503040fa84956b73349face7694076
diff --git a/system/dev/gpio/mt-8167/mt8167-gpio-regs.h b/system/dev/gpio/mt-8167/mt8167-gpio-regs.h index be1a049..bfc2d80 100644 --- a/system/dev/gpio/mt-8167/mt8167-gpio-regs.h +++ b/system/dev/gpio/mt-8167/mt8167-gpio-regs.h
@@ -11,13 +11,14 @@ template <> template <> __WEAK uint16_t ddk::MmioBuffer::Read<uint16_t>(zx_off_t offs) const { - return Read<uint16_t>(offs); + return *reinterpret_cast<volatile uint16_t*>(ptr_ + offs); } template <> template <> __WEAK void ddk::MmioBuffer::Write<uint16_t>(uint16_t val, zx_off_t offs) const { - Write<uint16_t>(val, offs); + *reinterpret_cast<volatile uint16_t*>(ptr_ + offs) = val; + hw_mb(); } namespace {