From 96bb0ba9e72297e98ecd2c2ce88cb4037d496ee5 Mon Sep 17 00:00:00 2001 From: Cliff Huang Date: Fri, 11 Feb 2022 17:46:00 -0800 Subject: drivers/wwan/fm: Add support for _PTS for Fibocom 5G WWAN Add DPTS (device prepare to sleep) method that is to be called in mainboard's \_SB.MPTS, which is called in _PTS. Signed-off-by: Cliff Huang Change-Id: Ie308f74940a33711a398bc11d0550cb06b55cdcf Reviewed-on: https://review.coreboot.org/c/coreboot/+/61886 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/drivers/wwan/fm/acpi_fm350gl.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/drivers/wwan/fm') diff --git a/src/drivers/wwan/fm/acpi_fm350gl.c b/src/drivers/wwan/fm/acpi_fm350gl.c index 67bd4a14e6..80370ad4ab 100644 --- a/src/drivers/wwan/fm/acpi_fm350gl.c +++ b/src/drivers/wwan/fm/acpi_fm350gl.c @@ -184,6 +184,22 @@ static void wwan_fm350gl_acpi_method_mrst_rst(const struct device *parent_dev, acpigen_write_method_end(); /* Method */ } +/* + * Generate DPTS (Device Prepare To Seep) Method. This is called in + * \.SB.MPTS Method. + */ +static void wwan_fm350gl_acpi_method_dpts(const struct device *parent_dev, + const struct drivers_wwan_fm_config *config) +{ + acpigen_write_method_serialized("DPTS", 1); + { + /* Perform 1st Half of FLDR Flow for cold reset: FHRF (1) */ + acpigen_emit_namestring("FHRF"); + acpigen_emit_byte(RESET_TYPE_COLD); + } + acpigen_write_method_end(); /* Method */ +} + static const char *wwan_fm350gl_acpi_name(const struct device *dev) { /* Attached device name must be "PXSX" for the Linux Kernel to recognize it. */ @@ -224,6 +240,7 @@ static void wwan_fm350gl_acpi_fill_ssdt(const struct device *dev) wwan_fm350gl_acpi_method_fhrf(parent, config); wwan_fm350gl_acpi_method_shrf(parent, config); wwan_fm350gl_acpi_method_rst(parent, config); + wwan_fm350gl_acpi_method_dpts(parent, config); /* NOTE: the 5G driver will call MRST._RST to trigger a cold reset * during firmware update. */ @@ -243,7 +260,7 @@ static struct device_operations wwan_fm350gl_ops = { .read_resources = noop_read_resources, .set_resources = noop_set_resources, .acpi_fill_ssdt = wwan_fm350gl_acpi_fill_ssdt, - .acpi_name = wwan_fm350gl_acpi_name, + .acpi_name = wwan_fm350gl_acpi_name }; static void wwan_fm350gl_acpi_enable(struct device *dev) -- cgit v1.2.3