<?xml version="1.0"?>

<!--
use "man thermal-conf.xml" for details
-->

<!-- BEGIN -->
<ThermalConfiguration>
<Platform>
	<Name>AMD Ryzen 5 3600 6-Core Processor</Name>
	<ProductName>*</ProductName>
	<UUID>*</UUID>
	<Preference>quiet</Preference>
	<ThermalSensors>
		<ThermalSensor>
			<!--CPU sensor on die -->
			<Type>CPU_TEMP_CORE</Type>
			<Path>/var/cache/kaede-thermals/cpu_core_temp</Path>
			<AsyncCapable>1</AsyncCapable>
		</ThermalSensor>
		<ThermalSensor>
			<!-- GPU sensor -->
			<Type>GPU_TEMP</Type>
			<Path>/var/cache/kaede-thermals/gpu_temp</Path>
			<AsyncCapable>1</AsyncCapable>
		</ThermalSensor>
	</ThermalSensors> 
	<ThermalZones>
		<ThermalZone>
			<Type>CPU_CTRL</Type>
			<TripPoints>
			<!-- CPU PASSIVE CONTROL -->
			<!-- Ideal temp: 70-75*C, Max temp: 95*C -->
				<TripPoint>
					<SensorType>CPU_TEMP_CORE</SensorType>
					<Temperature>65000</Temperature>
					<Type>passive</Type>
					<ControlType>parallel</ControlType>
					<CoolingDevice>
						<index>1</index>
						<type>CPU_FREQ0</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>2</index>
						<type>CPU_FREQ1</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>3</index>
						<type>CPU_FREQ2</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>4</index>
						<type>CPU_FREQ3</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>5</index>
						<type>CPU_FREQ4</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>6</index>
						<type>CPU_FREQ5</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>7</index>
						<type>CPU_FREQ6</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>8</index>
						<type>CPU_FREQ7</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>9</index>
						<type>CPU_FREQ8</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>10</index>
						<type>CPU_FREQ9</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>11</index>
						<type>CPU_FREQ10</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>12</index>
						<type>CPU_FREQ11</type>
						<influence>100</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
				</TripPoint>
			<!-- EMERGENCY THROTTLING. -->
			<!-- HOT means suspend the system. -->
			<!-- CRITICAL means turn off the system. -->
				<TripPoint>
					<SensorType>CPU_TEMP_CORE</SensorType>
					<Temperature>85000</Temperature>
					<Type>hot</Type>
				</TripPoint>
				<TripPoint>
					<SensorType>CPU_TEMP_CORE</SensorType>
					<Temperature>90000</Temperature>
					<Type>critical</Type>
				</TripPoint>
			</TripPoints>
		</ThermalZone>
		<ThermalZone>
			<Type>GPU_CTRL</Type>
			<TripPoints>
			<!-- GPU PASSIVE CONTROL -->
			<!-- Ideal temp: 70-75*C, Max temp: 90*C -->
				<TripPoint>
					<SensorType>GPU_TEMP</SensorType>
					<Temperature>70000</Temperature>
					<Type>passive</Type>
					<ControlType>parallel</ControlType>
					<CoolingDevice>
						<index>1</index>
						<type>GPU_FREQ_CORE</type>
						<influence>50</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
					<CoolingDevice>
						<index>2</index>
						<type>GPU_FREQ_MEM</type>
						<influence>50</influence>
						<SamplingPeriod>1</SamplingPeriod>
					</CoolingDevice>
				</TripPoint>
			</TripPoints>
		</ThermalZone>
	</ThermalZones>
        <CoolingDevices>
	<!-- CPU frequency scaling. -->
	<!-- This allows finer control of the CPU scaling in comparison to -->
	<!-- thermald's built in 'cpufreq' driver. -->
		<CoolingDevice>
			<Type>CPU_FREQ0</Type>
			<Path>/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ1</Type>
			<Path>/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ2</Type>
			<Path>/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ3</Type>
			<Path>/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ4</Type>
			<Path>/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ5</Type>
			<Path>/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ6</Type>
			<Path>/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ7</Type>
			<Path>/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ8</Type>
			<Path>/sys/devices/system/cpu/cpu8/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ9</Type>
			<Path>/sys/devices/system/cpu/cpu9/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ10</Type>
			<Path>/sys/devices/system/cpu/cpu10/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
		<CoolingDevice>
			<Type>CPU_FREQ11</Type>
			<Path>/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq</Path>
			<MinState>3600000</MinState>
			<MaxState>2200000</MaxState>
			<IncDecStep>-100000</IncDecStep>
			<ReadBack>1</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		</CoolingDevice>
	<!-- GPU frequency scaling. -->
	<!-- This is read by a custom service and translated into the format
	     expected by the video driver. -->
		<CoolingDevice>
			<Type>GPU_FREQ_CORE</Type>
			<Path>/var/cache/kaede-thermals/gpu_power_core</Path>
			<MinState>255</MinState>
			<MaxState>0</MaxState>
			<IncDecStep>-5</IncDecStep>
		<!-- Make sure ReadBack is disabled as our servive needs to
		     reset the value periodically. -->
			<ReadBack>0</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
		<!-- As negative values are possible and have special meaning,
		     leave room for the sign. -->
			<WritePrefix> </WritePrefix>
		</CoolingDevice>
		<CoolingDevice>
			<Type>GPU_FREQ_MEM</Type>
			<Path>/var/cache/kaede-thermals/gpu_power_mem</Path>
			<MinState>255</MinState>
			<MaxState>0</MaxState>
			<IncDecStep>-5</IncDecStep>
			<ReadBack>0</ReadBack>
			<AutoOffMode>1</AutoOffMode>
			<DebouncePeriod>10</DebouncePeriod>
			<WritePrefix> </WritePrefix>
		</CoolingDevice>
	</CoolingDevices>
</Platform>
</ThermalConfiguration>
