Lenovo Ideapad 330 (Ryzen)

Following settings aim to make Ideapad 330(-15ARR) usable.

UEFI Updates
Before removing Windows from the laptop, run the latest UEFI updates from Lenovo, as there is no way to do so once Linux is running.

Legacy boot
Do not use Compatibility Support Module (CSM) legacy boot services to run Linux, there are some firmware bugs preventing CPU frequency scaling from working.

Use rEFInd USB stick to boot into a UEFI installation media, or, to convert an existing system to EFI boot. This is beyond the scope of the article.

Firmware
The `linux-firmware` package is required as it provides the firmware for the AMDGPU driver and Atheros WiFi adapter.

Kernel
As of 4.18.2, everything is functional with the exception of the touchpad. The Lenovo website has Elan, ALPS, and Synaptics drivers available for this laptop so it's anyone's guess which is inside.

If the `amdgpu` module and its firmware are not included in the initramfs, the module may fail to load later due to a race condition and neither X nor virtual terminals will be accessible. This is random, and it may or may not fail. However, adding the amdgpu driver to the initramfs does prevent it entirely.

Rebuild initramfs using dracut.

Compiler settings
More info is available at:
 * GCC optimization
 * MAKEOPTS
 * EMERGE_DEFAULT_OPTS

Packages settings
For more info: CPU_FLAGS_X86

As of August 2018, your mileage may vary with released versions of Mesa, libdrm, and xf86-video-amdgpu. Adding to accept_keywords using `**` will bring in the latest code that has many unreleased fixes.

USE flags
With AMDGPU as video driver and libinput as input driver add the USE flag  and remove any NVIDIA-specific USE flags that may cause issues later.

battery charge thresholds
Use:. Example econfig and instructions can be found at: github.com/teleshoes/tpacpi-bat.

fan control
I was unable to make fan control work, but the plumbing is all there and it claims to be supported. Here's some tips.

Use:.