Lines Matching +full:slider +full:-

1 // SPDX-License-Identifier: GPL-2.0
3 * AMD Platform Management Framework Driver - Smart PC Capabilities
8 * Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
13 #include <linux/amd-pmf-io.h>
29 return "Unknown TA Slider State"; in ta_slider_as_str()
35 dev_dbg(dev->dev, "==== TA inputs START ====\n"); in amd_pmf_dump_ta_inputs()
36 dev_dbg(dev->dev, "Slider State: %s\n", ta_slider_as_str(in->ev_info.power_slider)); in amd_pmf_dump_ta_inputs()
37 dev_dbg(dev->dev, "Power Source: %s\n", amd_pmf_source_as_str(in->ev_info.power_source)); in amd_pmf_dump_ta_inputs()
38 dev_dbg(dev->dev, "Battery Percentage: %u\n", in->ev_info.bat_percentage); in amd_pmf_dump_ta_inputs()
39 dev_dbg(dev->dev, "Designed Battery Capacity: %u\n", in->ev_info.bat_design); in amd_pmf_dump_ta_inputs()
40 dev_dbg(dev->dev, "Fully Charged Capacity: %u\n", in->ev_info.full_charge_capacity); in amd_pmf_dump_ta_inputs()
41 dev_dbg(dev->dev, "Drain Rate: %d\n", in->ev_info.drain_rate); in amd_pmf_dump_ta_inputs()
42 dev_dbg(dev->dev, "Socket Power: %u\n", in->ev_info.socket_power); in amd_pmf_dump_ta_inputs()
43 dev_dbg(dev->dev, "Skin Temperature: %u\n", in->ev_info.skin_temperature); in amd_pmf_dump_ta_inputs()
44 dev_dbg(dev->dev, "Avg C0 Residency: %u\n", in->ev_info.avg_c0residency); in amd_pmf_dump_ta_inputs()
45 dev_dbg(dev->dev, "Max C0 Residency: %u\n", in->ev_info.max_c0residency); in amd_pmf_dump_ta_inputs()
46 dev_dbg(dev->dev, "GFX Busy: %u\n", in->ev_info.gfx_busy); in amd_pmf_dump_ta_inputs()
47 dev_dbg(dev->dev, "LID State: %s\n", in->ev_info.lid_state ? "close" : "open"); in amd_pmf_dump_ta_inputs()
48 dev_dbg(dev->dev, "User Presence: %s\n", in->ev_info.user_present ? "Present" : "Away"); in amd_pmf_dump_ta_inputs()
49 dev_dbg(dev->dev, "Ambient Light: %d\n", in->ev_info.ambient_light); in amd_pmf_dump_ta_inputs()
50 dev_dbg(dev->dev, "==== TA inputs END ====\n"); in amd_pmf_dump_ta_inputs()
69 in->ev_info.avg_c0residency = avg; in amd_pmf_get_c0_residency()
70 in->ev_info.max_c0residency = max; in amd_pmf_get_c0_residency()
76 memset(dev->buf, 0, dev->mtable_size); in amd_pmf_get_smu_info()
79 switch (dev->cpu_id) { in amd_pmf_get_smu_info()
81 memcpy(&dev->m_table, dev->buf, dev->mtable_size); in amd_pmf_get_smu_info()
82 in->ev_info.socket_power = dev->m_table.apu_power + dev->m_table.dgpu_power; in amd_pmf_get_smu_info()
83 in->ev_info.skin_temperature = dev->m_table.skin_temp; in amd_pmf_get_smu_info()
84 in->ev_info.gfx_busy = dev->m_table.avg_gfx_activity; in amd_pmf_get_smu_info()
85 amd_pmf_get_c0_residency(dev->m_table.avg_core_c0residency, in amd_pmf_get_smu_info()
86 ARRAY_SIZE(dev->m_table.avg_core_c0residency), in); in amd_pmf_get_smu_info()
90 memcpy(&dev->m_table_v2, dev->buf, dev->mtable_size); in amd_pmf_get_smu_info()
91 in->ev_info.socket_power = dev->m_table_v2.apu_power + dev->m_table_v2.dgpu_power; in amd_pmf_get_smu_info()
92 in->ev_info.skin_temperature = dev->m_table_v2.skin_temp; in amd_pmf_get_smu_info()
93 in->ev_info.gfx_busy = dev->m_table_v2.gfx_activity; in amd_pmf_get_smu_info()
94 amd_pmf_get_c0_residency(dev->m_table_v2.core_c0residency, in amd_pmf_get_smu_info()
95 ARRAY_SIZE(dev->m_table_v2.core_c0residency), in); in amd_pmf_get_smu_info()
98 dev_err(dev->dev, "Unsupported CPU id: 0x%x", dev->cpu_id); in amd_pmf_get_smu_info()
136 return -ENODEV; in amd_pmf_get_battery_info()
138 in->ev_info.bat_percentage = amd_pmf_get_battery_prop(POWER_SUPPLY_PROP_CAPACITY); in amd_pmf_get_battery_info()
140 in->ev_info.bat_design = amd_pmf_get_battery_prop(POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN) / in amd_pmf_get_battery_info()
142 in->ev_info.full_charge_capacity = amd_pmf_get_battery_prop(POWER_SUPPLY_PROP_ENERGY_FULL) / in amd_pmf_get_battery_info()
144 in->ev_info.drain_rate = amd_pmf_get_battery_prop(POWER_SUPPLY_PROP_POWER_NOW) / in amd_pmf_get_battery_info()
154 switch (dev->current_profile) { in amd_pmf_get_slider_info()
165 dev_err(dev->dev, "Unknown Platform Profile.\n"); in amd_pmf_get_slider_info()
166 return -EOPNOTSUPP; in amd_pmf_get_slider_info()
168 in->ev_info.power_slider = val; in amd_pmf_get_slider_info()
178 in->ev_info.user_present = false; in amd_pmf_get_sensor_info()
182 in->ev_info.ambient_light = sfh_info.ambient_light; in amd_pmf_get_sensor_info()
184 dev_dbg(dev->dev, "ALS is not enabled/detected\n"); in amd_pmf_get_sensor_info()
189 in->ev_info.user_present = true; in amd_pmf_get_sensor_info()
191 dev_dbg(dev->dev, "HPD is not enabled/detected\n"); in amd_pmf_get_sensor_info()
198 in->ev_info.lid_state = !acpi_lid_open(); in amd_pmf_populate_ta_inputs()
199 in->ev_info.power_source = amd_pmf_get_power_source(); in amd_pmf_populate_ta_inputs()