Lines Matching +full:surface +full:- +full:sam
1 // SPDX-License-Identifier: GPL-2.0+
3 * Surface Platform Profile / Performance Mode driver for Surface System
6 * Copyright (C) 2021-2022 Maximilian Luz <luzmaximilian@gmail.com>
88 return ssam_retry(__ssam_fan_profile_set, sdev->ctrl, &profile); in ssam_fan_profile_set()
107 dev_err(&sdev->dev, "invalid performance profile: %d", p); in convert_ssam_tmp_to_profile()
108 return -EINVAL; in convert_ssam_tmp_to_profile()
131 return -EOPNOTSUPP; in convert_profile_to_ssam_tmp()
153 return -EOPNOTSUPP; in convert_profile_to_ssam_fan()
166 status = ssam_tmp_profile_get(tpd->sdev, &tp); in ssam_platform_profile_get()
170 status = convert_ssam_tmp_to_profile(tpd->sdev, tp); in ssam_platform_profile_get()
186 tp = convert_profile_to_ssam_tmp(tpd->sdev, profile); in ssam_platform_profile_set()
190 tp = ssam_tmp_profile_set(tpd->sdev, tp); in ssam_platform_profile_set()
194 if (tpd->has_fan) { in ssam_platform_profile_set()
195 tp = convert_profile_to_ssam_fan(tpd->sdev, profile); in ssam_platform_profile_set()
198 tp = ssam_fan_profile_set(tpd->sdev, tp); in ssam_platform_profile_set()
224 tpd = devm_kzalloc(&sdev->dev, sizeof(*tpd), GFP_KERNEL); in surface_platform_profile_probe()
226 return -ENOMEM; in surface_platform_profile_probe()
228 tpd->sdev = sdev; in surface_platform_profile_probe()
231 tpd->has_fan = device_property_read_bool(&sdev->dev, "has_fan"); in surface_platform_profile_probe()
233 tpd->ppdev = devm_platform_profile_register(&sdev->dev, "Surface Platform Profile", in surface_platform_profile_probe()
236 return PTR_ERR_OR_ZERO(tpd->ppdev); in surface_platform_profile_probe()
240 { SSAM_SDEV(TMP, SAM, 0x00, 0x01) },
256 MODULE_DESCRIPTION("Platform Profile Support for Surface System Aggregator Module");