You've already forked T2-Debian-and-Ubuntu-Kernel
mirror of
https://github.com/t2linux/T2-Debian-and-Ubuntu-Kernel.git
synced 2026-04-30 13:49:30 -07:00
Initial commit
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
kind: pipeline
|
||||
name: mbp-ubuntu-kernel
|
||||
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
- pull_request
|
||||
|
||||
steps:
|
||||
- name: lint
|
||||
image: alpine
|
||||
pull: always
|
||||
commands:
|
||||
- apk add --no-cache shellcheck python3 bash
|
||||
- pip3 install yamllint
|
||||
- yamllint .
|
||||
- shellcheck ./*.sh
|
||||
|
||||
- name: build
|
||||
image: ubuntu:20.04
|
||||
pull: always
|
||||
volumes:
|
||||
- name: build-artifacts
|
||||
path: /tmp/artifacts
|
||||
commands:
|
||||
- ./build.sh
|
||||
|
||||
- name: publish-github
|
||||
image: plugins/github-release
|
||||
volumes:
|
||||
- name: build-artifacts
|
||||
path: /tmp/artifacts
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: github_token
|
||||
files: /tmp/artifacts/*
|
||||
prerelease: true
|
||||
when:
|
||||
event: tag
|
||||
|
||||
volumes:
|
||||
- name: build-artifacts
|
||||
temp: {}
|
||||
@@ -0,0 +1,3 @@
|
||||
/patches/custom-drivers.patch
|
||||
/releases
|
||||
/linux-*
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
---
|
||||
language: bash
|
||||
|
||||
os:
|
||||
- linux
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
script:
|
||||
- ./publish.sh
|
||||
@@ -0,0 +1,129 @@
|
||||
# mbp-ubuntu-kernel
|
||||
|
||||
Ubuntu/Mint/Debian kernel 5.6 with Apple T2 patches built-in (Macbooks produced >= 2018).
|
||||
|
||||
Drivers:
|
||||
|
||||
- Apple T2 (audio, keyboard, touchpad) - <https://github.com/MCMrARM/mbp2018-bridge-drv>
|
||||
- Apple SMC - <https://github.com/MCMrARM/mbp2018-etc>
|
||||
- Touchbar - <https://github.com/roadrunner2/macbook12-spi-driver/tree/mbp15>
|
||||
|
||||
This project is closely inspired by mikeeq/mbp-fedora-kernel. Thank you @mikeeq for the scripts and setup.
|
||||
|
||||
IF YOU ENJOY THIS CODE, CONSIDER CONTRIBUTING TO THE AUTHORS @MCMrARM @roadrunner2 @aunali1 @ppaulweber @mikeeq, they did all the hard work.
|
||||
|
||||
## CI status
|
||||
|
||||
Drone kernel build status:
|
||||
[](https://cloud.drone.io/marcosfad/mbp-ubuntu-kernel)
|
||||
|
||||
Travis kernel publish status - <http://mbp-ubuntu-kernel.herokuapp.com/> :
|
||||
[](https://travis-ci.com/marcosfad/mbp-ubuntu-kernel)
|
||||
|
||||
## TODO
|
||||
|
||||
### Known issues
|
||||
|
||||
- Dynamic audio input/output change (on connecting/disconnecting headphones jack)
|
||||
- TouchID - (@MCMrARM is working on it - https://github.com/Dunedan/mbp-2016-linux/issues/71#issuecomment-528545490)
|
||||
- Thunderbolt (is disabled, because driver was causing kernel panics (not tested with 5.5 kernel))
|
||||
- Microphone (it's recognised with new apple t2 sound driver, but there is a low mic volume amp)
|
||||
|
||||
#### Working with upstream stable kernel 5.1
|
||||
|
||||
- Display/Screen
|
||||
- USB-C
|
||||
- Battery/AC
|
||||
- Ethernet/Video USB-C adapters
|
||||
- Bluetooth
|
||||
|
||||
#### Working with mbp-ubuntu-kernel
|
||||
|
||||
- NVMe
|
||||
- Camera
|
||||
- keyboard
|
||||
- touchpad (scroll, right click)
|
||||
- wifi (not Macbook pro 16,1)
|
||||
- you need to manually extract firmware from macOS
|
||||
- <https://github.com/Dunedan/mbp-2016-linux/issues/71#issuecomment-517444300>
|
||||
- <https://github.com/Dunedan/mbp-2016-linux/issues/71#issuecomment-515401480>
|
||||
- or download it from <https://packages.aunali1.com/apple/wifi-fw/18G2022>
|
||||
|
||||
> Firmware can be found by running `ioreg -l | grep C-4364` or `ioreg -l | grep RequestedFiles` under macOS
|
||||
|
||||
```
|
||||
Put the firmware in the right place!
|
||||
The .trx file for your model goes to /lib/firmware/brcm/brcmfmac4364-pcie.bin,
|
||||
the .clmb goes to /lib/firmware/brcm/brcmfmac4364-pcie.clm_blob
|
||||
and the .txt to something like /lib/firmware/brcm/brcmfmac4364-pcie.Apple Inc.-MacBookPro15,2.txt
|
||||
```
|
||||
|
||||
```
|
||||
# ls -l /lib/firmware/brcm | grep 4364
|
||||
-rw-r--r--. 1 root root 12860 Mar 1 12:44 brcmfmac4364-pcie.Apple Inc.-MacBookPro15,2.txt
|
||||
-rw-r--r--. 1 root root 922647 Mar 1 12:44 brcmfmac4364-pcie.bin
|
||||
-rw-r--r--. 1 root root 33226 Mar 1 12:44 brcmfmac4364-pcie.clm_blob
|
||||
```
|
||||
|
||||
```
|
||||
# dmesg
|
||||
brcmfmac 0000:01:00.0: enabling device (0000 -> 0002)
|
||||
brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364-pcie for chip BCM4364/3
|
||||
brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4364-pcie for chip BCM4364/3
|
||||
brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4364/3 wl0: Mar 28 2019 19:17:52 version 9.137.9.0.32.6.34 FWID 01-36f56c94
|
||||
brcmfmac 0000:01:00.0 wlp1s0: renamed from wlan0
|
||||
```
|
||||
|
||||
#### Working with external drivers
|
||||
|
||||
>> with @MCMrARM mbp2018-bridge-drv
|
||||
|
||||
- keyboard
|
||||
- touchpad
|
||||
- touchbar
|
||||
- audio
|
||||
|
||||
#### Not tested
|
||||
|
||||
- eGPU
|
||||
- Thunderbolt
|
||||
|
||||
## Docs
|
||||
|
||||
- Discord: <https://discord.gg/Uw56rqW>
|
||||
- WiFi firmware: <https://packages.aunali1.com/apple/wifi-fw/18G2022>
|
||||
- blog `Installing Fedora 31 on a 2018 Mac mini`: <https://linuxwit.ch/blog/2020/01/installing-fedora-on-mac-mini/>
|
||||
- iwd:
|
||||
- <https://iwd.wiki.kernel.org/networkconfigurationsettings>
|
||||
- <https://wiki.archlinux.org/index.php/Iwd>
|
||||
- <https://www.vocal.com/secure-communication/eap-types/>
|
||||
|
||||
### Ubuntu
|
||||
|
||||
- <https://wiki.ubuntu.com/KernelTeam/GitKernelBuild>
|
||||
- <https://help.ubuntu.com/community/Repositories/Personal>
|
||||
- <https://medium.com/sqooba/create-your-own-custom-and-authenticated-apt-repository-1e4a4cf0b864>
|
||||
- <https://help.ubuntu.com/community/Kernel/Compile>
|
||||
- <https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel>
|
||||
- <https://www.linux.com/training-tutorials/kernel-newbie-corner-building-and-running-new-kernel/>
|
||||
- <https://wiki.ubuntu.com/KernelTeam/KernelMaintenance>
|
||||
|
||||
### Github
|
||||
|
||||
- GitHub issue (RE history): <https://github.com/Dunedan/mbp-2016-linux/issues/71>
|
||||
- VHCI+Sound driver (Apple T2): <https://github.com/MCMrARM/mbp2018-bridge-drv/>
|
||||
- AppleSMC driver (fan control): <https://github.com/MCMrARM/mbp2018-etc/tree/master/applesmc>
|
||||
- hid-apple keyboard backlight patch: <https://github.com/MCMrARM/mbp2018-etc/tree/master/apple-hid>
|
||||
- TouchBar driver: <https://github.com/roadrunner2/macbook12-spi-driver/tree/mbp15>
|
||||
- Kernel patches (all are mentioned in github issue above): <https://github.com/aunali1/linux-mbp-arch>
|
||||
- ArchLinux kernel patches: <https://github.com/ppaulweber/linux-mba>
|
||||
- hid-apple-patched module for changing mappings of ctrl, fn, option keys: <https://github.com/free5lot/hid-apple-patched>
|
||||
|
||||
## Credits
|
||||
|
||||
- @MCMrARM - thanks for all RE work
|
||||
- @ozbenh - thanks for submitting NVME patch
|
||||
- @roadrunner2 - thanks for SPI (touchbar) driver
|
||||
- @aunali1 - thanks for ArchLinux Kernel CI
|
||||
- @ppaulweber - thanks for keyboard and Macbook Air patches
|
||||
- @mikeeq - thanks for the fedora kernel project and compilation scripts
|
||||
@@ -0,0 +1,65 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
ARG RELEASE_VERSION=5.6.4
|
||||
ARG GPG_KEY=some_key
|
||||
ARG GPG_PASS=some_pass
|
||||
ARG GPG_KEY_ID=some_id
|
||||
|
||||
ENV GITHUB_URL=github.com/marcosfad/mbp-ubuntu-kernel/releases
|
||||
ENV REPO_URL=mbp-ubuntu-kernel.herokuapp.com
|
||||
ENV LANG en_US.utf8
|
||||
|
||||
WORKDIR /var/repo
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
locales dpkg-dev dpkg-sig nginx gettext wget curl apt-utils \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||
|
||||
RUN echo "${GPG_KEY}" > PRIVATE_GPG_KEY.asc \
|
||||
&& gpg -v --batch --passphrase "${GPG_PASS}" --import PRIVATE_GPG_KEY.asc \
|
||||
&& rm PRIVATE_GPG_KEY.asc \
|
||||
&& gpg --list-keys \
|
||||
&& gpg --output /var/repo/KEY.gpg --armor --export ${GPG_KEY_ID}
|
||||
|
||||
RUN for deb in $(curl -s https://${REPO_URL}/ -L | grep deb | grep a | cut -d'>' -f2 | cut -d'<' -f1); do \
|
||||
wget -q --backups=1 https://${REPO_URL}/${deb}; \
|
||||
done \
|
||||
; rm -rfv *.1
|
||||
|
||||
RUN echo "${GPG_PASS}" > PRIVATE_GPG_PASS \
|
||||
&& export GPG_TTY=$(tty) && \
|
||||
for deb in $(curl -s https://${GITHUB_URL}/latest -L | grep deb | grep span | cut -d'>' -f2 | cut -d'<' -f1); do \
|
||||
wget -q --backups=1 https://${GITHUB_URL}/download/v${RELEASE_VERSION}/${deb} && \
|
||||
dpkg-sig -k ${GPG_KEY_ID} -v --sign builder "./${deb}" \
|
||||
--gpg-options="--batch --pinentry-mode loopback --no-tty --passphrase-file ./PRIVATE_GPG_PASS"; \
|
||||
done \
|
||||
; rm PRIVATE_GPG_PASS \
|
||||
; rm -rfv *.1
|
||||
|
||||
RUN apt-ftparchive --arch amd64 packages . > Packages \
|
||||
&& gzip -k -f Packages \
|
||||
&& apt-ftparchive release . > Release
|
||||
|
||||
RUN echo "${GPG_PASS}" | gpg --batch --pinentry-mode loopback --yes --default-key "${GPG_KEY_ID}"\
|
||||
--passphrase-fd 0 -abs -o Release.gpg Release \
|
||||
&& echo "${GPG_PASS}" | gpg --batch --pinentry-mode loopback --yes --default-key "${GPG_KEY_ID}"\
|
||||
--passphrase-fd 0 --clearsign -o InRelease Release
|
||||
|
||||
RUN chown -R www-data:www-data /var/repo && rm -rfv "/var/repo/${REPO_URL}" && ls -la /var/repo
|
||||
|
||||
COPY --chown=www-data:www-data nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
RUN mkdir -p /var/lib/nginx \
|
||||
&& chown -R www-data:www-data /var/lib/nginx
|
||||
|
||||
RUN touch /var/run/nginx.pid && \
|
||||
chown -R www-data:www-data /var/run/nginx.pid
|
||||
|
||||
USER www-data
|
||||
|
||||
ENV PORT=8080
|
||||
EXPOSE ${PORT}
|
||||
|
||||
CMD /bin/bash -c "envsubst '\$PORT' < /etc/nginx/nginx.conf > /tmp/nginx.conf; cat /tmp/nginx.conf > /etc/nginx/nginx.conf" && nginx -g 'daemon off;'
|
||||
@@ -0,0 +1,26 @@
|
||||
Install the Heroku CLI
|
||||
|
||||
Download and install the Heroku CLI.
|
||||
|
||||
If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key.
|
||||
|
||||
$ heroku login
|
||||
Create a new Git repository
|
||||
|
||||
Initialize a git repository in a new or existing directory
|
||||
|
||||
$ cd my-project/
|
||||
$ git init
|
||||
$ heroku git:remote -a mbp-ubuntu-kernel
|
||||
Deploy your application
|
||||
|
||||
Commit your code to the repository and deploy it to Heroku using Git.
|
||||
|
||||
$ git add .
|
||||
$ git commit -am "make it better"
|
||||
$ git push heroku master
|
||||
Existing Git repository
|
||||
|
||||
For existing repositories, simply add the heroku remote
|
||||
|
||||
$ heroku git:remote -a mbp-ubuntu-kernel
|
||||
@@ -0,0 +1,34 @@
|
||||
#NGINX main config
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
server_names_hash_bucket_size 128;
|
||||
|
||||
resolver 8.8.8.8 8.8.4.4;
|
||||
|
||||
server {
|
||||
listen $PORT default_server;
|
||||
root /var/repo;
|
||||
location / {
|
||||
index index.php index.html index.htm;
|
||||
autoindex on; #enable listing of directory index
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
## Update docker image tag, because kernel build is using `uname -r` when defining package version variable
|
||||
# KERNEL_VERSION=$(curl -s https://www.kernel.org | grep '<strong>' | head -3 | tail -1 | cut -d'>' -f3 | cut -d'<' -f1)
|
||||
KERNEL_VERSION=5.6.5
|
||||
REPO_PATH=$(pwd)
|
||||
WORKING_PATH=/root/work
|
||||
KERNEL_PATH="${WORKING_PATH}/linux-kernel"
|
||||
GIT_USERNAME="Ubuntu MBP"
|
||||
GIT_EMAIL="turkos+ubuntu-mbp@gmail.com"
|
||||
|
||||
### Debug commands
|
||||
echo "KERNEL_VERSION=$KERNEL_VERSION"
|
||||
echo "${WORKING_PATH}"
|
||||
echo "Current path: ${REPO_PATH}"
|
||||
echo "CPU threads: $(nproc --all)"
|
||||
grep 'model name' /proc/cpuinfo | uniq
|
||||
|
||||
### Clean up
|
||||
rm -rfv ./*.deb
|
||||
|
||||
mkdir "${WORKING_PATH}" && cd "${WORKING_PATH}"
|
||||
cp -rf "${REPO_PATH}"/{patches,templates} "${WORKING_PATH}"
|
||||
rm -rf linux-*
|
||||
|
||||
### Dependencies
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt update
|
||||
apt install -y build-essential fakeroot libncurses-dev bison flex libssl-dev libelf-dev \
|
||||
openssl dkms libudev-dev libpci-dev libiberty-dev autoconf wget xz-utils git \
|
||||
bc rsync cpio dh-modaliases debhelper kernel-wedge
|
||||
|
||||
### get Kernel
|
||||
git clone --depth 1 --single-branch --branch v"${KERNEL_VERSION}" \
|
||||
git://kernel.ubuntu.com/virgin/linux-stable.git "${KERNEL_PATH}"
|
||||
cd ./linux-kernel || exit
|
||||
git config user.name "${GIT_USERNAME}"
|
||||
git config user.email "${GIT_EMAIL}"
|
||||
|
||||
#### Create patch file with custom drivers
|
||||
echo >&2 "===]> Info: Creating patch file... "
|
||||
KERNEL_VERSION="${KERNEL_VERSION}" WORKING_PATH="${WORKING_PATH}" "${REPO_PATH}/patch_driver.sh"
|
||||
|
||||
#### Apply patches
|
||||
cd "${KERNEL_PATH}" || exit
|
||||
|
||||
echo >&2 "===]> Info: Applying patches... "
|
||||
[ ! -d "${WORKING_PATH}/patches" ] && {
|
||||
echo 'Patches directory not found!'
|
||||
exit 1
|
||||
}
|
||||
while IFS= read -r file; do
|
||||
echo "adding $file"
|
||||
patch -p1 <"$file"
|
||||
done < <(find "${WORKING_PATH}/patches" -type f -name "*.patch" | sort)
|
||||
|
||||
### Add new drivers. This config files comes on the one of the patches...
|
||||
echo "CONFIG_APPLE_BCE_DRIVER=m" >>"${KERNEL_PATH}/debian.master/config/amd64/config.common.ubuntu"
|
||||
echo "CONFIG_APPLE_TOUCHBAR_DRIVER=m" >>"${KERNEL_PATH}/debian.master/config/amd64/config.common.ubuntu"
|
||||
find "${KERNEL_PATH}/debian.master/config/" -type f -name "generic.modules" -exec sh -c '
|
||||
echo -e "apple-bce.ko\napple-ib-als.ko\napple-ib-tb.ko\napple-ibridge.ko" >> $1
|
||||
' sh {} \;
|
||||
|
||||
chmod a+x "${KERNEL_PATH}"/debian/rules
|
||||
chmod a+x "${KERNEL_PATH}"/debian/scripts/*
|
||||
chmod a+x "${KERNEL_PATH}"/debian/scripts/misc/*
|
||||
|
||||
# Get rid of the dirty tag
|
||||
|
||||
### Copy configuration
|
||||
fakeroot debian/rules clean
|
||||
yes '' | fakeroot /bin/bash -c "export DROOT=debian; export ARCH=amd64; \
|
||||
${KERNEL_PATH}/debian/scripts/misc/kernelconfig updateconfigs amd64" || true
|
||||
|
||||
cp "${KERNEL_PATH}/debian.master/config/amd64/config.flavour.generic" ".config"
|
||||
|
||||
make olddefconfig
|
||||
|
||||
#### Change buildid to mbp
|
||||
echo >&2 "===]> Info: Bulding src... "
|
||||
make clean
|
||||
cd "${KERNEL_PATH}"
|
||||
git add .
|
||||
git commit -s -a -m "getting rid of -dirty"
|
||||
make -j "$(getconf _NPROCESSORS_ONLN)" deb-pkg LOCALVERSION=-mbp
|
||||
|
||||
#### Copy artifacts to shared volume
|
||||
echo >&2 "===]> Info: Copying debs and calculating SHA256 ... "
|
||||
#cp -rfv ../*.deb "${REPO_PATH}/"
|
||||
cp -rfv ../*.deb /tmp/artifacts/
|
||||
sha256sum ../*.deb >/tmp/artifacts/sha256
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
DOCKER_IMAGE=ubuntu:20.04
|
||||
|
||||
docker pull ${DOCKER_IMAGE}
|
||||
docker run \
|
||||
-t \
|
||||
--rm \
|
||||
-v "$(pwd)":/repo \
|
||||
${DOCKER_IMAGE} \
|
||||
/bin/bash -c 'cd /repo && ./build.sh'
|
||||
Executable
+75
@@ -0,0 +1,75 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
#KERNEL_VERSION="${KERNEL_VERSION}"
|
||||
#WORKING_PATH="${WORKING_PATH}"
|
||||
BUILD_PATH=/tmp/build-kernel
|
||||
|
||||
### Apple T2 drivers commit hashes
|
||||
APPLE_BCE_DRIVER_GIT_URL=https://github.com/aunali1/mbp2018-bridge-drv.git
|
||||
APPLE_BCE_DRIVER_BRANCH_NAME=aur
|
||||
APPLE_BCE_DRIVER_COMMIT_HASH=c884d9ca731f2118a58c28bb78202a0007935998
|
||||
APPLE_IB_DRIVER_GIT_URL=https://github.com/roadrunner2/macbook12-spi-driver.git
|
||||
APPLE_IB_DRIVER_BRANCH_NAME=mbp15
|
||||
APPLE_IB_DRIVER_COMMIT_HASH=90cea3e8e32db60147df8d39836bd1d2a5161871
|
||||
APPLE_SMC_DRIVER_GIT_URL=https://github.com/aunali1/linux-mbp-arch
|
||||
APPLE_SMC_DRIVER_BRANCH_NAME=master
|
||||
APPLE_SMC_DRIVER_COMMIT_HASH=4c19bf4009a9ee0bf4d9f3406e9d030fe3b85101
|
||||
|
||||
rm -rf "${BUILD_PATH}"
|
||||
mkdir -p "${BUILD_PATH}"
|
||||
cd "${BUILD_PATH}" || exit
|
||||
|
||||
### AppleSMC and BT aunali fixes
|
||||
git clone --single-branch --branch ${APPLE_SMC_DRIVER_BRANCH_NAME} ${APPLE_SMC_DRIVER_GIT_URL} \
|
||||
"${BUILD_PATH}/linux-mbp-arch"
|
||||
cd "${BUILD_PATH}/linux-mbp-arch" || exit
|
||||
git checkout ${APPLE_SMC_DRIVER_COMMIT_HASH}
|
||||
|
||||
while IFS= read -r file; do
|
||||
echo "adding ${file}"
|
||||
cp -rfv "${file}" "${WORKING_PATH}"/patches/"${file##*/}"
|
||||
done < <(find "${BUILD_PATH}/linux-mbp-arch" -type f -name "*applesmc*" | sort)
|
||||
|
||||
### Add custom drivers to kernel
|
||||
echo -e "From: \"Kernel Builder (sita)\" <ubuntu-kernel-bot@canonical.com>\nSubject: patch custom drivers\n" >"${WORKING_PATH}/patches/custom-drivers.patch"
|
||||
|
||||
git clone --depth 1 --single-branch --branch v"${KERNEL_VERSION}" \
|
||||
git://kernel.ubuntu.com/virgin/linux-stable.git "${BUILD_PATH}/linux-stable"
|
||||
cd "${BUILD_PATH}/linux-stable/drivers" || exit
|
||||
|
||||
### apple-bce
|
||||
git clone --depth 1 --single-branch --branch "${APPLE_BCE_DRIVER_BRANCH_NAME}" \
|
||||
"${APPLE_BCE_DRIVER_GIT_URL}" "${BUILD_PATH}/linux-stable/drivers/apple-bce"
|
||||
cd "${BUILD_PATH}/linux-stable/drivers/apple-bce" || exit
|
||||
git checkout "${APPLE_BCE_DRIVER_COMMIT_HASH}" && rm -rf .git
|
||||
|
||||
cd "${BUILD_PATH}/linux-stable/drivers"
|
||||
cp -rfv "${WORKING_PATH}/templates/Kconfig" "${BUILD_PATH}/linux-stable/drivers/apple-bce/Kconfig"
|
||||
sed -i "s/TEST_DRIVER/APPLE_BCE_DRIVER/g" "${BUILD_PATH}/linux-stable/drivers/apple-bce/Kconfig"
|
||||
# shellcheck disable=SC2016
|
||||
sed -i 's/obj-m/obj-$(CONFIG_APPLE_BCE)/g' "${BUILD_PATH}/linux-stable/drivers/apple-bce/Makefile"
|
||||
|
||||
# ### apple-ib
|
||||
git clone --single-branch --branch "${APPLE_IB_DRIVER_BRANCH_NAME}" \
|
||||
"${APPLE_IB_DRIVER_GIT_URL}" "${BUILD_PATH}/linux-stable/drivers/apple-touchbar"
|
||||
cd "${BUILD_PATH}/linux-stable/drivers/apple-touchbar" || exit
|
||||
git checkout "${APPLE_IB_DRIVER_COMMIT_HASH}" && rm -rf .git
|
||||
|
||||
cd "${BUILD_PATH}/linux-stable/drivers"
|
||||
cp -rfv "${WORKING_PATH}/templates/Kconfig" "${BUILD_PATH}/linux-stable/drivers/apple-touchbar/Kconfig"
|
||||
sed -i "s/TEST_DRIVER/APPLE_TOUCHBAR_DRIVER/g" "${BUILD_PATH}/linux-stable/drivers/apple-touchbar/Kconfig"
|
||||
# shellcheck disable=SC2016
|
||||
sed -i 's/obj-m/obj-$(CONFIG_APPLE_TOUCHBAR)/g' "${BUILD_PATH}/linux-stable/drivers/apple-touchbar/Makefile"
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
echo 'obj-$(CONFIG_APPLE_BCE) += apple-bce/' >>"${BUILD_PATH}/linux-stable/drivers/Makefile"
|
||||
# shellcheck disable=SC2016
|
||||
echo 'obj-$(CONFIG_APPLE_TOUCHBAR) += apple-touchbar/' >>"${BUILD_PATH}/linux-stable/drivers/Makefile"
|
||||
sed -i "\$i source \"drivers/apple-bce/Kconfig\"\n" "${BUILD_PATH}/linux-stable/drivers/Kconfig"
|
||||
sed -i "\$i source \"drivers/apple-touchbar/Kconfig\"\n" "${BUILD_PATH}/linux-stable/drivers/Kconfig"
|
||||
|
||||
## Prepare patch
|
||||
git add .
|
||||
git diff HEAD >> "${WORKING_PATH}/patches/custom-drivers.patch"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
From f8ffd7f03324dc25cc0fa21f6bcb9ec8a5665e8d Mon Sep 17 00:00:00 2001
|
||||
From: Andy Whitcroft <apw@canonical.com>
|
||||
Date: Fri, 9 Sep 2016 14:02:29 +0100
|
||||
Subject: [PATCH 2/5] UBUNTU: SAUCE: add vmlinux.strip to BOOT_TARGETS1 on
|
||||
powerpc
|
||||
|
||||
Signed-off-by: Andy Whitcroft <apw@canonical.com>
|
||||
---
|
||||
arch/powerpc/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
|
||||
index f35730548e42..fbda4b5a9916 100644
|
||||
--- a/arch/powerpc/Makefile
|
||||
+++ b/arch/powerpc/Makefile
|
||||
@@ -285,7 +285,7 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
|
||||
all: zImage
|
||||
|
||||
# With make 3.82 we cannot mix normal and wildcard targets
|
||||
-BOOT_TARGETS1 := zImage zImage.initrd uImage
|
||||
+BOOT_TARGETS1 := zImage zImage.initrd uImage vmlinux.strip
|
||||
BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.%
|
||||
|
||||
PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From 20ea1fd38324f8053cbd890b8b5a6c1fc17a4b03 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Whitcroft <apw@canonical.com>
|
||||
Date: Fri, 27 May 2016 13:52:22 +0100
|
||||
Subject: [PATCH 3/5] UBUNTU: SAUCE: tools/hv/lsvmbus -- add manual page
|
||||
|
||||
BugLink: http://bugs.launchpad.net/bugs/1585311
|
||||
|
||||
Signed-off-by: Andy Whitcroft <apw@canonical.com>
|
||||
Acked-by: Tim Gardner <tim.gardner@canonical.com>
|
||||
Acked-by: Brad Figg <brad.figg@canonical.com>
|
||||
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
|
||||
---
|
||||
tools/hv/lsvmbus.8 | 23 +++++++++++++++++++++++
|
||||
1 file changed, 23 insertions(+)
|
||||
create mode 100644 tools/hv/lsvmbus.8
|
||||
|
||||
diff --git a/tools/hv/lsvmbus.8 b/tools/hv/lsvmbus.8
|
||||
new file mode 100644
|
||||
index 000000000000..ba07d664950e
|
||||
--- /dev/null
|
||||
+++ b/tools/hv/lsvmbus.8
|
||||
@@ -0,0 +1,23 @@
|
||||
+.\" This page Copyright (C) 2016 Andy Whitcroft <apw@canonical.com>
|
||||
+.\" Distributed under the GPL v2 or later.
|
||||
+.TH LSVMBUS 8
|
||||
+.SH NAME
|
||||
+lsvmbus \- List Hyper-V VMBus devices
|
||||
+.SH SYNOPSIS
|
||||
+.ft B
|
||||
+.B lsvmbus [-vv]
|
||||
+.br
|
||||
+.SH DESCRIPTION
|
||||
+\fBlsvmbus\fP
|
||||
+displays devices attached to the Hyper-V VMBus.
|
||||
+.SH OPTIONS
|
||||
+.\"
|
||||
+.TP
|
||||
+.B -v
|
||||
+With -v more information is printed including the VMBus Rel_ID, class ID,
|
||||
+Rel_ID, and which channel is bound to which virtual processor. Use -vv
|
||||
+for additional detail including the Device_ID and the sysfs path.
|
||||
+.\"
|
||||
+.SH AUTHORS
|
||||
+.nf
|
||||
+Written by Dexuan Cui <decui@microsoft.com>
|
||||
--
|
||||
2.17.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,263 @@
|
||||
From 42050990dc22431d045070866b3425fa845eea22 Mon Sep 17 00:00:00 2001
|
||||
From: "Kernel Builder (sita)" <ubuntu-kernel-bot@canonical.com>
|
||||
Date: Fri, 17 Apr 2020 16:30:43 +0000
|
||||
Subject: [PATCH 5/5] configs (based on Ubuntu-5.6.0-7.7)
|
||||
|
||||
---
|
||||
debian.master/config/amd64/config.common.amd64 | 1 -
|
||||
.../config/amd64/config.flavour.generic | 1 -
|
||||
.../config/amd64/config.flavour.lowlatency | 1 -
|
||||
debian.master/config/arm64/config.common.arm64 | 4 +---
|
||||
debian.master/config/armhf/config.common.armhf | 2 --
|
||||
debian.master/config/config.common.ubuntu | 17 +++--------------
|
||||
debian.master/config/i386/config.common.i386 | 1 -
|
||||
.../config/i386/config.flavour.generic | 1 -
|
||||
.../config/i386/config.flavour.lowlatency | 1 -
|
||||
.../config/ppc64el/config.common.ppc64el | 2 --
|
||||
debian.master/config/s390x/config.common.s390x | 1 -
|
||||
11 files changed, 4 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/debian.master/config/amd64/config.common.amd64 b/debian.master/config/amd64/config.common.amd64
|
||||
index a473a9a03a7f..d0098d1ed9c1 100644
|
||||
--- a/debian.master/config/amd64/config.common.amd64
|
||||
+++ b/debian.master/config/amd64/config.common.amd64
|
||||
@@ -183,7 +183,6 @@ CONFIG_HFSPLUS_FS=m
|
||||
CONFIG_HFS_FS=m
|
||||
CONFIG_HIBERNATION=y
|
||||
CONFIG_HID=m
|
||||
-CONFIG_HIO=m
|
||||
CONFIG_HMC6352=m
|
||||
CONFIG_HOTPLUG_PCI=y
|
||||
CONFIG_HOTPLUG_PCI_SHPC=y
|
||||
diff --git a/debian.master/config/amd64/config.flavour.generic b/debian.master/config/amd64/config.flavour.generic
|
||||
index d1662374ea94..5938d9ba3f6c 100644
|
||||
--- a/debian.master/config/amd64/config.flavour.generic
|
||||
+++ b/debian.master/config/amd64/config.flavour.generic
|
||||
@@ -4,7 +4,6 @@
|
||||
CONFIG_HZ=250
|
||||
# CONFIG_HZ_1000 is not set
|
||||
CONFIG_HZ_250=y
|
||||
-# CONFIG_IRQ_FORCED_THREADING_DEFAULT is not set
|
||||
# CONFIG_LATENCYTOP is not set
|
||||
# CONFIG_PREEMPT is not set
|
||||
CONFIG_PREEMPT_VOLUNTARY=y
|
||||
diff --git a/debian.master/config/amd64/config.flavour.lowlatency b/debian.master/config/amd64/config.flavour.lowlatency
|
||||
index 814348dc984b..42de09fb0bff 100644
|
||||
--- a/debian.master/config/amd64/config.flavour.lowlatency
|
||||
+++ b/debian.master/config/amd64/config.flavour.lowlatency
|
||||
@@ -4,7 +4,6 @@
|
||||
CONFIG_HZ=1000
|
||||
CONFIG_HZ_1000=y
|
||||
# CONFIG_HZ_250 is not set
|
||||
-CONFIG_IRQ_FORCED_THREADING_DEFAULT=y
|
||||
CONFIG_LATENCYTOP=y
|
||||
CONFIG_PREEMPT=y
|
||||
# CONFIG_PREEMPT_VOLUNTARY is not set
|
||||
diff --git a/debian.master/config/arm64/config.common.arm64 b/debian.master/config/arm64/config.common.arm64
|
||||
index dfe622def83c..69180578ddf4 100644
|
||||
--- a/debian.master/config/arm64/config.common.arm64
|
||||
+++ b/debian.master/config/arm64/config.common.arm64
|
||||
@@ -165,7 +165,7 @@ CONFIG_FEALNX=m
|
||||
CONFIG_FIREWIRE=m
|
||||
CONFIG_FIREWIRE_NOSY=m
|
||||
CONFIG_FIXED_PHY=y
|
||||
-CONFIG_FORCE_MAX_ZONEORDER=13
|
||||
+CONFIG_FORCE_MAX_ZONEORDER=11
|
||||
CONFIG_FPGA_BRIDGE=m
|
||||
CONFIG_FPGA_DFL=m
|
||||
CONFIG_FRAME_WARN=1024
|
||||
@@ -195,7 +195,6 @@ CONFIG_HFSPLUS_FS=m
|
||||
CONFIG_HFS_FS=m
|
||||
# CONFIG_HIBERNATION is not set
|
||||
CONFIG_HID=m
|
||||
-# CONFIG_HIO is not set
|
||||
CONFIG_HMC6352=m
|
||||
CONFIG_HOTPLUG_PCI=y
|
||||
CONFIG_HOTPLUG_PCI_SHPC=y
|
||||
@@ -283,7 +282,6 @@ CONFIG_IPMI_HANDLER=m
|
||||
# CONFIG_IPMMU_VMSA is not set
|
||||
# CONFIG_IP_DCCP_CCID3 is not set
|
||||
CONFIG_IRQ_BYPASS_MANAGER=y
|
||||
-# CONFIG_IRQ_FORCED_THREADING_DEFAULT is not set
|
||||
CONFIG_ISL29003=m
|
||||
CONFIG_ISL29020=m
|
||||
CONFIG_JFS_FS=m
|
||||
diff --git a/debian.master/config/armhf/config.common.armhf b/debian.master/config/armhf/config.common.armhf
|
||||
index 5407bc1cd66b..97651f0e6512 100644
|
||||
--- a/debian.master/config/armhf/config.common.armhf
|
||||
+++ b/debian.master/config/armhf/config.common.armhf
|
||||
@@ -184,7 +184,6 @@ CONFIG_HFSPLUS_FS=m
|
||||
CONFIG_HFS_FS=m
|
||||
CONFIG_HIBERNATION=y
|
||||
CONFIG_HID=m
|
||||
-# CONFIG_HIO is not set
|
||||
CONFIG_HMC6352=m
|
||||
# CONFIG_HOTPLUG_PCI is not set
|
||||
CONFIG_HPFS_FS=m
|
||||
@@ -267,7 +266,6 @@ CONFIG_IPACK_BUS=m
|
||||
CONFIG_IPMI_HANDLER=m
|
||||
CONFIG_IPMMU_VMSA=y
|
||||
# CONFIG_IP_DCCP_CCID3 is not set
|
||||
-# CONFIG_IRQ_FORCED_THREADING_DEFAULT is not set
|
||||
CONFIG_ISL29003=m
|
||||
CONFIG_ISL29020=m
|
||||
CONFIG_JFS_FS=m
|
||||
diff --git a/debian.master/config/config.common.ubuntu b/debian.master/config/config.common.ubuntu
|
||||
index b63878493c30..c26dcf10c136 100644
|
||||
--- a/debian.master/config/config.common.ubuntu
|
||||
+++ b/debian.master/config/config.common.ubuntu
|
||||
@@ -281,10 +281,7 @@ CONFIG_AMD_XGBE_DCB=y
|
||||
CONFIG_AMD_XGBE_HAVE_ECC=y
|
||||
CONFIG_AMILO_RFKILL=m
|
||||
CONFIG_AMLOGIC_THERMAL=m
|
||||
-CONFIG_ANDROID_BINDERFS=m
|
||||
-CONFIG_ANDROID_BINDER_DEVICES=""
|
||||
-CONFIG_ANDROID_BINDER_IPC=m
|
||||
-# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
|
||||
+# CONFIG_ANDROID_BINDER_IPC is not set
|
||||
CONFIG_APB_TIMER=y
|
||||
CONFIG_APDS9300=m
|
||||
CONFIG_APDS9960=m
|
||||
@@ -767,7 +764,7 @@ CONFIG_ARM_TI_CPUFREQ=y
|
||||
CONFIG_ARM_VEXPRESS_SPC_CPUFREQ=m
|
||||
CONFIG_ARM_VIRT_EXT=y
|
||||
CONFIG_AS3935=m
|
||||
-CONFIG_ASHMEM=m
|
||||
+# CONFIG_ASHMEM is not set
|
||||
CONFIG_ASN1=y
|
||||
CONFIG_ASPEED_ADC=m
|
||||
CONFIG_ASPEED_BT_IPMI_BMC=m
|
||||
@@ -2436,7 +2433,6 @@ CONFIG_DELL_SMBIOS=m
|
||||
CONFIG_DELL_SMBIOS_SMM=y
|
||||
CONFIG_DELL_SMBIOS_WMI=y
|
||||
CONFIG_DELL_SMO8800=m
|
||||
-CONFIG_DELL_UART_BACKLIGHT=m
|
||||
CONFIG_DELL_WMI=m
|
||||
CONFIG_DELL_WMI_AIO=m
|
||||
CONFIG_DELL_WMI_DESCRIPTOR=m
|
||||
@@ -3546,7 +3542,7 @@ CONFIG_GAMEPORT_L4=m
|
||||
CONFIG_GAMEPORT_NS558=m
|
||||
CONFIG_GARP=m
|
||||
CONFIG_GART_IOMMU=y
|
||||
-CONFIG_GCC_VERSION=90201
|
||||
+CONFIG_GCC_VERSION=90300
|
||||
# CONFIG_GCOV_KERNEL is not set
|
||||
CONFIG_GDB_SCRIPTS=y
|
||||
CONFIG_GEMINI_ETHERNET=m
|
||||
@@ -5338,7 +5334,6 @@ CONFIG_LOCKDEP_SUPPORT=y
|
||||
CONFIG_LOCKD_V4=y
|
||||
CONFIG_LOCKUP_DETECTOR=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
-CONFIG_LOCK_DOWN_IN_SECURE_BOOT=y
|
||||
# CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set
|
||||
# CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set
|
||||
CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y
|
||||
@@ -8451,14 +8446,12 @@ CONFIG_RTLWIFI_USB=m
|
||||
CONFIG_RTL_CARDS=m
|
||||
CONFIG_RTS5208=m
|
||||
CONFIG_RTW88=m
|
||||
-CONFIG_RTW88_8723DE=y
|
||||
CONFIG_RTW88_8822BE=y
|
||||
CONFIG_RTW88_8822CE=y
|
||||
CONFIG_RTW88_CORE=m
|
||||
CONFIG_RTW88_DEBUG=y
|
||||
CONFIG_RTW88_DEBUGFS=y
|
||||
CONFIG_RTW88_PCI=m
|
||||
-# CONFIG_RTW88_REGD_USER_REG_HINTS is not set
|
||||
# CONFIG_RT_GROUP_SCHED is not set
|
||||
CONFIG_RT_MUTEXES=y
|
||||
CONFIG_RUNTIME_TESTING_MENU=y
|
||||
@@ -9046,8 +9039,6 @@ CONFIG_SGI_XP=m
|
||||
CONFIG_SGL_ALLOC=y
|
||||
CONFIG_SG_POOL=y
|
||||
CONFIG_SG_SPLIT=y
|
||||
-CONFIG_SHIFT_FS=m
|
||||
-CONFIG_SHIFT_FS_POSIX_ACL=y
|
||||
CONFIG_SHMEM=y
|
||||
CONFIG_SHUFFLE_PAGE_ALLOCATOR=y
|
||||
CONFIG_SH_ETH=m
|
||||
@@ -11143,7 +11134,6 @@ CONFIG_VCNL4035=m
|
||||
CONFIG_VDSO=y
|
||||
CONFIG_VEML6030=m
|
||||
CONFIG_VEML6070=m
|
||||
-CONFIG_VERSION_SIGNATURE=""
|
||||
CONFIG_VETH=m
|
||||
CONFIG_VEXPRESS_CONFIG=y
|
||||
CONFIG_VEXPRESS_SYSCFG=y
|
||||
@@ -11577,7 +11567,6 @@ CONFIG_WATCHDOG_RTAS=m
|
||||
CONFIG_WATCHDOG_SYSFS=y
|
||||
CONFIG_WCN36XX=m
|
||||
# CONFIG_WCN36XX_DEBUGFS is not set
|
||||
-# CONFIG_WCN36XX_SNAPDRAGON_HACKS is not set
|
||||
CONFIG_WD80x3=m
|
||||
CONFIG_WDAT_WDT=m
|
||||
CONFIG_WDT=m
|
||||
diff --git a/debian.master/config/i386/config.common.i386 b/debian.master/config/i386/config.common.i386
|
||||
index 52b30381e1b2..0268d7a4c6da 100644
|
||||
--- a/debian.master/config/i386/config.common.i386
|
||||
+++ b/debian.master/config/i386/config.common.i386
|
||||
@@ -180,7 +180,6 @@ CONFIG_HFSPLUS_FS=m
|
||||
CONFIG_HFS_FS=m
|
||||
CONFIG_HIBERNATION=y
|
||||
CONFIG_HID=m
|
||||
-CONFIG_HIO=m
|
||||
CONFIG_HMC6352=m
|
||||
CONFIG_HOTPLUG_PCI=y
|
||||
CONFIG_HOTPLUG_PCI_SHPC=y
|
||||
diff --git a/debian.master/config/i386/config.flavour.generic b/debian.master/config/i386/config.flavour.generic
|
||||
index 5c2e4e1d3a9f..965113b110ce 100644
|
||||
--- a/debian.master/config/i386/config.flavour.generic
|
||||
+++ b/debian.master/config/i386/config.flavour.generic
|
||||
@@ -4,6 +4,5 @@
|
||||
CONFIG_HZ=250
|
||||
# CONFIG_HZ_1000 is not set
|
||||
CONFIG_HZ_250=y
|
||||
-# CONFIG_IRQ_FORCED_THREADING_DEFAULT is not set
|
||||
# CONFIG_PREEMPT is not set
|
||||
CONFIG_PREEMPT_VOLUNTARY=y
|
||||
diff --git a/debian.master/config/i386/config.flavour.lowlatency b/debian.master/config/i386/config.flavour.lowlatency
|
||||
index 6b121e3f433b..0af82e00adce 100644
|
||||
--- a/debian.master/config/i386/config.flavour.lowlatency
|
||||
+++ b/debian.master/config/i386/config.flavour.lowlatency
|
||||
@@ -4,6 +4,5 @@
|
||||
CONFIG_HZ=1000
|
||||
CONFIG_HZ_1000=y
|
||||
# CONFIG_HZ_250 is not set
|
||||
-CONFIG_IRQ_FORCED_THREADING_DEFAULT=y
|
||||
CONFIG_PREEMPT=y
|
||||
# CONFIG_PREEMPT_VOLUNTARY is not set
|
||||
diff --git a/debian.master/config/ppc64el/config.common.ppc64el b/debian.master/config/ppc64el/config.common.ppc64el
|
||||
index 7761c349c82c..1945b4564116 100644
|
||||
--- a/debian.master/config/ppc64el/config.common.ppc64el
|
||||
+++ b/debian.master/config/ppc64el/config.common.ppc64el
|
||||
@@ -182,7 +182,6 @@ CONFIG_HFSPLUS_FS=m
|
||||
CONFIG_HFS_FS=m
|
||||
# CONFIG_HIBERNATION is not set
|
||||
CONFIG_HID=m
|
||||
-# CONFIG_HIO is not set
|
||||
CONFIG_HMC6352=m
|
||||
CONFIG_HOTPLUG_PCI=y
|
||||
# CONFIG_HOTPLUG_PCI_SHPC is not set
|
||||
@@ -265,7 +264,6 @@ CONFIG_IPACK_BUS=m
|
||||
CONFIG_IPMI_HANDLER=m
|
||||
# CONFIG_IP_DCCP_CCID3 is not set
|
||||
CONFIG_IRQ_BYPASS_MANAGER=y
|
||||
-# CONFIG_IRQ_FORCED_THREADING_DEFAULT is not set
|
||||
CONFIG_ISL29003=m
|
||||
CONFIG_ISL29020=m
|
||||
CONFIG_JFS_FS=m
|
||||
diff --git a/debian.master/config/s390x/config.common.s390x b/debian.master/config/s390x/config.common.s390x
|
||||
index 6ea96d850eae..12fbc11c1c32 100644
|
||||
--- a/debian.master/config/s390x/config.common.s390x
|
||||
+++ b/debian.master/config/s390x/config.common.s390x
|
||||
@@ -169,7 +169,6 @@ CONFIG_GPIO_GENERIC_PLATFORM=m
|
||||
# CONFIG_HFS_FS is not set
|
||||
# CONFIG_HIBERNATION is not set
|
||||
# CONFIG_HID is not set
|
||||
-# CONFIG_HIO is not set
|
||||
# CONFIG_HMC6352 is not set
|
||||
CONFIG_HOTPLUG_PCI=y
|
||||
# CONFIG_HOTPLUG_PCI_SHPC is not set
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
From c5c75744f812e8fefa9a4a8706fe137c06c52814 Mon Sep 17 00:00:00 2001
|
||||
From: Aun-Ali Zaidi <admin@kodeit.net>
|
||||
Date: Fri, 10 Jan 2020 12:47:25 -0600
|
||||
Subject: [PATCH 1/2] brcmfmac: move brcmf_mp_device into its own header
|
||||
|
||||
This commit relocates the brcmf_mp_device struct into its own header. This aids
|
||||
in utilizing the struct without the redefinition of the existing included headers
|
||||
found in common.h, such as fwil_types.h.
|
||||
|
||||
Tested-by: Aun-Ali Zaidi <admin@kodeit.net>
|
||||
Signed-off-by: Aun-Ali Zaidi <admin@kodeit.net>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/common.h | 36 +++--------------
|
||||
.../broadcom/brcm80211/brcmfmac/settings.h | 39 +++++++++++++++++++
|
||||
2 files changed, 44 insertions(+), 31 deletions(-)
|
||||
create mode 100644 drivers/net/wireless/broadcom/brcm80211/brcmfmac/settings.h
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
|
||||
index 144cf4570bc3..3826403ec5ff 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
|
||||
@@ -8,15 +8,14 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/platform_data/brcmfmac.h>
|
||||
#include "fwil_types.h"
|
||||
+#include "settings.h"
|
||||
|
||||
#define BRCMF_FW_ALTPATH_LEN 256
|
||||
|
||||
-/* Definitions for the module global and device specific settings are defined
|
||||
- * here. Two structs are used for them. brcmf_mp_global_t and brcmf_mp_device.
|
||||
- * The mp_global is instantiated once in a global struct and gets initialized
|
||||
- * by the common_attach function which should be called before any other
|
||||
- * (module) initiliazation takes place. The device specific settings is part
|
||||
- * of the drvr struct and should be initialized on every brcmf_attach.
|
||||
+/* Definition for the module global settings are defined here. One struct is
|
||||
+ * used called brcmf_mp_global_t. The mp_global is instantiated once in a
|
||||
+ * global struct and gets initialized by the common_attach function which
|
||||
+ * should be called before any other (module) initiliazation takes place.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -30,31 +29,6 @@ struct brcmf_mp_global_t {
|
||||
|
||||
extern struct brcmf_mp_global_t brcmf_mp_global;
|
||||
|
||||
-/**
|
||||
- * struct brcmf_mp_device - Device module paramaters.
|
||||
- *
|
||||
- * @p2p_enable: Legacy P2P0 enable (old wpa_supplicant).
|
||||
- * @feature_disable: Feature_disable bitmask.
|
||||
- * @fcmode: FWS flow control.
|
||||
- * @roamoff: Firmware roaming off?
|
||||
- * @ignore_probe_fail: Ignore probe failure.
|
||||
- * @country_codes: If available, pointer to struct for translating country codes
|
||||
- * @bus: Bus specific platform data. Only SDIO at the mmoment.
|
||||
- */
|
||||
-struct brcmf_mp_device {
|
||||
- bool p2p_enable;
|
||||
- unsigned int feature_disable;
|
||||
- int fcmode;
|
||||
- bool roamoff;
|
||||
- bool iapp;
|
||||
- bool ignore_probe_fail;
|
||||
- struct brcmfmac_pd_cc *country_codes;
|
||||
- const char *board_type;
|
||||
- union {
|
||||
- struct brcmfmac_sdio_pd sdio;
|
||||
- } bus;
|
||||
-};
|
||||
-
|
||||
void brcmf_c_set_joinpref_default(struct brcmf_if *ifp);
|
||||
|
||||
struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/settings.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/settings.h
|
||||
new file mode 100644
|
||||
index 000000000000..5c4aa32fb73d
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/settings.h
|
||||
@@ -0,0 +1,39 @@
|
||||
+// SPDX-License-Identifier: ISC
|
||||
+/*
|
||||
+ * Copyright (c) 2014 Broadcom Corporation
|
||||
+ */
|
||||
+
|
||||
+#ifndef BRCMFMAC_SETTINGS_H
|
||||
+#define BRCMFMAC_SETTINGS_H
|
||||
+
|
||||
+/* Definition for the device specific settings are defined here. One struct
|
||||
+ * is used called brcmf_mp_device. The device specific settings is part of
|
||||
+ * the drvr struct and should be initialized on every brcmf_attach.
|
||||
+ */
|
||||
+
|
||||
+/**
|
||||
+ * struct brcmf_mp_device - Device module paramaters.
|
||||
+ *
|
||||
+ * @p2p_enable: Legacy P2P0 enable (old wpa_supplicant).
|
||||
+ * @feature_disable: Feature_disable bitmask.
|
||||
+ * @fcmode: FWS flow control.
|
||||
+ * @roamoff: Firmware roaming off?
|
||||
+ * @ignore_probe_fail: Ignore probe failure.
|
||||
+ * @country_codes: If available, pointer to struct for translating country codes
|
||||
+ * @bus: Bus specific platform data. Only SDIO at the mmoment.
|
||||
+ */
|
||||
+struct brcmf_mp_device {
|
||||
+ bool p2p_enable;
|
||||
+ unsigned int feature_disable;
|
||||
+ int fcmode;
|
||||
+ bool roamoff;
|
||||
+ bool iapp;
|
||||
+ bool ignore_probe_fail;
|
||||
+ struct brcmfmac_pd_cc *country_codes;
|
||||
+ const char *board_type;
|
||||
+ union {
|
||||
+ struct brcmfmac_sdio_pd sdio;
|
||||
+ } bus;
|
||||
+};
|
||||
+
|
||||
+#endif /* BRCMFMAC_SETTINGS_H */
|
||||
--
|
||||
2.24.1
|
||||
@@ -0,0 +1,221 @@
|
||||
From b4865b976ef02fe69bb0d03c6fda6ecb2f173bcb Mon Sep 17 00:00:00 2001
|
||||
From: Aun-Ali Zaidi <admin@kodeit.net>
|
||||
Date: Fri, 10 Jan 2020 19:41:21 -0600
|
||||
Subject: [PATCH 2/2] brcmfmac: Add ability to manually specify FW rambase
|
||||
address
|
||||
|
||||
This commit introduces the ability to manually pass the rambase address for
|
||||
the brcmfmac chip as a kernel module option. The existing brcmf_chip_tcm_rambase()
|
||||
function is bypassed when this option is supplied. This is very useful when
|
||||
debugging support for newer chipsets that are not provided by the aforementioned
|
||||
function.
|
||||
|
||||
Tested-by: Aun-Ali Zaidi <admin@kodeit.net>
|
||||
Signed-off-by: Aun-Ali Zaidi <admin@kodeit.net>
|
||||
---
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/chip.c | 17 ++++++++++-------
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/chip.h | 7 +++++--
|
||||
.../broadcom/brcm80211/brcmfmac/common.c | 5 +++++
|
||||
.../broadcom/brcm80211/brcmfmac/common.h | 1 -
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 4 ++--
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
|
||||
.../broadcom/brcm80211/brcmfmac/settings.h | 4 ++++
|
||||
7 files changed, 27 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
|
||||
index a795d781b4c5..e6b6f23e15a5 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
|
||||
@@ -696,7 +696,7 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-int brcmf_chip_get_raminfo(struct brcmf_chip *pub)
|
||||
+int brcmf_chip_get_raminfo(struct brcmf_chip *pub, struct brcmf_mp_device *settings)
|
||||
{
|
||||
struct brcmf_chip_priv *ci = container_of(pub, struct brcmf_chip_priv,
|
||||
pub);
|
||||
@@ -707,7 +707,8 @@ int brcmf_chip_get_raminfo(struct brcmf_chip *pub)
|
||||
if (mem) {
|
||||
mem_core = container_of(mem, struct brcmf_core_priv, pub);
|
||||
ci->pub.ramsize = brcmf_chip_tcm_ramsize(mem_core);
|
||||
- ci->pub.rambase = brcmf_chip_tcm_rambase(ci);
|
||||
+ ci->pub.rambase = (settings != NULL && settings->rambase_addr > 0) ? settings->rambase_addr
|
||||
+ : brcmf_chip_tcm_rambase(ci);
|
||||
if (!ci->pub.rambase) {
|
||||
brcmf_err("RAM base not provided with ARM CR4 core\n");
|
||||
return -EINVAL;
|
||||
@@ -718,7 +719,8 @@ int brcmf_chip_get_raminfo(struct brcmf_chip *pub)
|
||||
mem_core = container_of(mem, struct brcmf_core_priv,
|
||||
pub);
|
||||
ci->pub.ramsize = brcmf_chip_sysmem_ramsize(mem_core);
|
||||
- ci->pub.rambase = brcmf_chip_tcm_rambase(ci);
|
||||
+ ci->pub.rambase = (settings != NULL && settings->rambase_addr > 0) ? settings->rambase_addr
|
||||
+ : brcmf_chip_tcm_rambase(ci);
|
||||
if (!ci->pub.rambase) {
|
||||
brcmf_err("RAM base not provided with ARM CA7 core\n");
|
||||
return -EINVAL;
|
||||
@@ -904,7 +906,7 @@ int brcmf_chip_dmp_erom_scan(struct brcmf_chip_priv *ci)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int brcmf_chip_recognition(struct brcmf_chip_priv *ci)
|
||||
+static int brcmf_chip_recognition(struct brcmf_chip_priv *ci, struct brcmf_mp_device *settings)
|
||||
{
|
||||
struct brcmf_core *core;
|
||||
u32 regdata;
|
||||
@@ -977,7 +979,7 @@ static int brcmf_chip_recognition(struct brcmf_chip_priv *ci)
|
||||
brcmf_chip_set_passive(&ci->pub);
|
||||
}
|
||||
|
||||
- return brcmf_chip_get_raminfo(&ci->pub);
|
||||
+ return brcmf_chip_get_raminfo(&ci->pub, settings);
|
||||
}
|
||||
|
||||
static void brcmf_chip_disable_arm(struct brcmf_chip_priv *chip, u16 id)
|
||||
@@ -1051,7 +1053,8 @@ static int brcmf_chip_setup(struct brcmf_chip_priv *chip)
|
||||
}
|
||||
|
||||
struct brcmf_chip *brcmf_chip_attach(void *ctx,
|
||||
- const struct brcmf_buscore_ops *ops)
|
||||
+ const struct brcmf_buscore_ops *ops,
|
||||
+ struct brcmf_mp_device *settings)
|
||||
{
|
||||
struct brcmf_chip_priv *chip;
|
||||
int err = 0;
|
||||
@@ -1080,7 +1083,7 @@ struct brcmf_chip *brcmf_chip_attach(void *ctx,
|
||||
if (err < 0)
|
||||
goto fail;
|
||||
|
||||
- err = brcmf_chip_recognition(chip);
|
||||
+ err = brcmf_chip_recognition(chip, settings);
|
||||
if (err < 0)
|
||||
goto fail;
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
|
||||
index 7b00f6a59e89..db982154e0d3 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
+#include "settings.h"
|
||||
+
|
||||
#define CORE_CC_REG(base, field) \
|
||||
(base + offsetof(struct chipcregs, field))
|
||||
|
||||
@@ -69,9 +71,10 @@ struct brcmf_buscore_ops {
|
||||
void (*activate)(void *ctx, struct brcmf_chip *chip, u32 rstvec);
|
||||
};
|
||||
|
||||
-int brcmf_chip_get_raminfo(struct brcmf_chip *pub);
|
||||
+int brcmf_chip_get_raminfo(struct brcmf_chip *pub, struct brcmf_mp_device *settings);
|
||||
struct brcmf_chip *brcmf_chip_attach(void *ctx,
|
||||
- const struct brcmf_buscore_ops *ops);
|
||||
+ const struct brcmf_buscore_ops *ops,
|
||||
+ struct brcmf_mp_device *settings);
|
||||
void brcmf_chip_detach(struct brcmf_chip *chip);
|
||||
struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *chip, u16 coreid);
|
||||
struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *chip);
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
index dec25e415619..384549237cce 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
@@ -67,6 +67,10 @@ static int brcmf_iapp_enable;
|
||||
module_param_named(iapp, brcmf_iapp_enable, int, 0);
|
||||
MODULE_PARM_DESC(iapp, "Enable partial support for the obsoleted Inter-Access Point Protocol");
|
||||
|
||||
+static uint brcmf_rambase_addr;
|
||||
+module_param_named(rambase_addr, brcmf_rambase_addr, uint, 0);
|
||||
+MODULE_PARM_DESC(rambase_addr, "Manually specify FW shared rambase address");
|
||||
+
|
||||
#ifdef DEBUG
|
||||
/* always succeed brcmf_bus_started() */
|
||||
static int brcmf_ignore_probe_fail;
|
||||
@@ -416,6 +420,7 @@ struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
|
||||
#ifdef DEBUG
|
||||
settings->ignore_probe_fail = !!brcmf_ignore_probe_fail;
|
||||
#endif
|
||||
+ settings->rambase_addr = brcmf_rambase_addr;
|
||||
|
||||
if (bus_type == BRCMF_BUSTYPE_SDIO)
|
||||
settings->bus.sdio.txglomsz = brcmf_sdiod_txglomsz;
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
|
||||
index 3826403ec5ff..c7a93e04a5f5 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
|
||||
@@ -6,7 +6,6 @@
|
||||
#define BRCMFMAC_COMMON_H
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
-#include <linux/platform_data/brcmfmac.h>
|
||||
#include "fwil_types.h"
|
||||
#include "settings.h"
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
index f64ce5074a55..ba42e1404683 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -1770,7 +1770,7 @@ static void brcmf_pcie_setup(struct device *dev, int ret,
|
||||
nvram_len = fwreq->items[BRCMF_PCIE_FW_NVRAM].nv_data.len;
|
||||
kfree(fwreq);
|
||||
|
||||
- ret = brcmf_chip_get_raminfo(devinfo->ci);
|
||||
+ ret = brcmf_chip_get_raminfo(devinfo->ci, devinfo->settings);
|
||||
if (ret) {
|
||||
brcmf_err(bus, "Failed to get RAM info\n");
|
||||
goto fail;
|
||||
@@ -1882,7 +1882,7 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
devinfo->pdev = pdev;
|
||||
pcie_bus_dev = NULL;
|
||||
- devinfo->ci = brcmf_chip_attach(devinfo, &brcmf_pcie_buscore_ops);
|
||||
+ devinfo->ci = brcmf_chip_attach(devinfo, &brcmf_pcie_buscore_ops, devinfo->settings);
|
||||
if (IS_ERR(devinfo->ci)) {
|
||||
ret = PTR_ERR(devinfo->ci);
|
||||
devinfo->ci = NULL;
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
index 264ad63232f8..2f0dc4002e88 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
@@ -3921,7 +3921,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdio *bus)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- bus->ci = brcmf_chip_attach(sdiodev, &brcmf_sdio_buscore_ops);
|
||||
+ bus->ci = brcmf_chip_attach(sdiodev, &brcmf_sdio_buscore_ops, sdiodev->settings);
|
||||
if (IS_ERR(bus->ci)) {
|
||||
brcmf_err("brcmf_chip_attach failed!\n");
|
||||
bus->ci = NULL;
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/settings.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/settings.h
|
||||
index 5c4aa32fb73d..9840a4cd3b2e 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/settings.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/settings.h
|
||||
@@ -6,6 +6,8 @@
|
||||
#ifndef BRCMFMAC_SETTINGS_H
|
||||
#define BRCMFMAC_SETTINGS_H
|
||||
|
||||
+#include <linux/platform_data/brcmfmac.h>
|
||||
+
|
||||
/* Definition for the device specific settings are defined here. One struct
|
||||
* is used called brcmf_mp_device. The device specific settings is part of
|
||||
* the drvr struct and should be initialized on every brcmf_attach.
|
||||
@@ -21,6 +23,7 @@
|
||||
* @ignore_probe_fail: Ignore probe failure.
|
||||
* @country_codes: If available, pointer to struct for translating country codes
|
||||
* @bus: Bus specific platform data. Only SDIO at the mmoment.
|
||||
+ * @rambase_addr: Manually specified FW shared rambase address.
|
||||
*/
|
||||
struct brcmf_mp_device {
|
||||
bool p2p_enable;
|
||||
@@ -34,6 +37,7 @@ struct brcmf_mp_device {
|
||||
union {
|
||||
struct brcmfmac_sdio_pd sdio;
|
||||
} bus;
|
||||
+ u32 rambase_addr;
|
||||
};
|
||||
|
||||
#endif /* BRCMFMAC_SETTINGS_H */
|
||||
--
|
||||
2.24.1
|
||||
@@ -0,0 +1,24 @@
|
||||
From: fedora kernel <fedora@kernel.org>
|
||||
Subject: patch camera
|
||||
|
||||
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
|
||||
index 10cfe8e51626..6a81c7ffda5f 100644
|
||||
--- a/drivers/media/usb/uvc/uvc_driver.c
|
||||
+++ b/drivers/media/usb/uvc/uvc_driver.c
|
||||
@@ -2874,6 +2874,15 @@ static const struct usb_device_id uvc_ids[] = {
|
||||
.bInterfaceSubClass = 1,
|
||||
.bInterfaceProtocol = 0,
|
||||
.driver_info = UVC_INFO_META(V4L2_META_FMT_D4XX) },
|
||||
+ /* Apple Built-In iSight via iBridge */
|
||||
+ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
|
||||
+ | USB_DEVICE_ID_MATCH_INT_INFO,
|
||||
+ .idVendor = 0x05ac,
|
||||
+ .idProduct = 0x8514,
|
||||
+ .bInterfaceClass = USB_CLASS_VIDEO,
|
||||
+ .bInterfaceSubClass = 1,
|
||||
+ .bInterfaceProtocol = 0,
|
||||
+ .driver_info = (kernel_ulong_t)&uvc_quirk_probe_def },
|
||||
/* Generic USB Video Class */
|
||||
{ USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_UNDEFINED) },
|
||||
{ USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15) },
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
From: fedora kernel <fedora@kernel.org>
|
||||
Subject: patch hid-apple-mod
|
||||
|
||||
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
|
||||
index 1cb4199..3f30d04 100644
|
||||
--- a/drivers/hid/hid-apple.c
|
||||
+++ b/drivers/hid/hid-apple.c
|
||||
@@ -7,6 +7,7 @@
|
||||
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
|
||||
* Copyright (c) 2006-2007 Jiri Kosina
|
||||
* Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com>
|
||||
+ * Copyright (c) 2019 Paul Pawlowski <paul@mrarm.io>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -16,6 +17,7 @@
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/hid.h>
|
||||
+#include <linux/leds.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
@@ -30,6 +31,7 @@
|
||||
#define APPLE_INVERT_HWHEEL 0x0040
|
||||
#define APPLE_IGNORE_HIDINPUT 0x0080
|
||||
#define APPLE_NUMLOCK_EMULATION 0x0100
|
||||
+#define APPLE_BACKLIGHT_CTL 0x0200
|
||||
|
||||
#define APPLE_FLAG_FKEY 0x01
|
||||
|
||||
@@ -51,12 +53,32 @@
|
||||
"(For people who want to keep Windows PC keyboard muscle memory. "
|
||||
"[0] = as-is, Mac layout. 1 = swapped, Windows layout.)");
|
||||
|
||||
+static unsigned int swap_fn_leftctrl;
|
||||
+module_param(swap_fn_leftctrl, uint, 0644);
|
||||
+MODULE_PARM_DESC(swap_fn_leftctrl, "Swap the Fn and left Control keys. "
|
||||
+ "(For people who want to keep PC keyboard muscle memory. "
|
||||
+ "[0] = as-is, Mac layout, 1 = swapped, PC layout)");
|
||||
+
|
||||
+static unsigned int rightalt_as_rightctrl;
|
||||
+module_param(rightalt_as_rightctrl, uint, 0644);
|
||||
+MODULE_PARM_DESC(rightalt_as_rightctrl, "Use the right Alt key as a right Ctrl key. "
|
||||
+ "[0] = as-is, Mac layout. 1 = Right Alt is right Ctrl");
|
||||
+
|
||||
+struct apple_sc_backlight;
|
||||
+
|
||||
struct apple_sc {
|
||||
unsigned long quirks;
|
||||
unsigned int fn_on;
|
||||
DECLARE_BITMAP(pressed_numlock, KEY_CNT);
|
||||
+ struct apple_sc_backlight *backlight;
|
||||
};
|
||||
|
||||
+struct apple_sc_backlight {
|
||||
+ struct led_classdev cdev;
|
||||
+ struct hid_device *hdev;
|
||||
+ unsigned short backlight_off, backlight_on_min, backlight_on_max;
|
||||
+ };
|
||||
+
|
||||
struct apple_key_translation {
|
||||
u16 from;
|
||||
u16 to;
|
||||
@@ -162,6 +184,16 @@
|
||||
{ }
|
||||
};
|
||||
|
||||
+static const struct apple_key_translation swapped_fn_leftctrl_keys[] = {
|
||||
+ { KEY_FN, KEY_LEFTCTRL },
|
||||
+ { }
|
||||
+};
|
||||
+
|
||||
+static const struct apple_key_translation rightalt_as_rightctrl_keys[] = {
|
||||
+ { KEY_RIGHTALT, KEY_RIGHTCTRL },
|
||||
+ { }
|
||||
+};
|
||||
+
|
||||
static const struct apple_key_translation *apple_find_translation(
|
||||
const struct apple_key_translation *table, u16 from)
|
||||
{
|
||||
@@ -183,9 +215,11 @@
|
||||
bool do_translate;
|
||||
u16 code = 0;
|
||||
|
||||
- if (usage->code == KEY_FN) {
|
||||
+ u16 fn_keycode = (swap_fn_leftctrl) ? (KEY_LEFTCTRL) : (KEY_FN);
|
||||
+
|
||||
+ if (usage->code == fn_keycode) {
|
||||
asc->fn_on = !!value;
|
||||
- input_event(input, usage->type, usage->code, value);
|
||||
+ input_event(input, usage->type, KEY_FN, value);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -270,6 +304,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ if (rightalt_as_rightctrl) {
|
||||
+ trans = apple_find_translation(rightalt_as_rightctrl_keys, usage->code);
|
||||
+ if (trans) {
|
||||
+ input_event(input, usage->type, trans->to, value);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (swap_fn_leftctrl) {
|
||||
+ trans = apple_find_translation(swapped_fn_leftctrl_keys, usage->code);
|
||||
+ if (trans) {
|
||||
+ input_event(input, usage->type, trans->to, value);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -333,6 +383,16 @@
|
||||
|
||||
for (trans = apple_iso_keyboard; trans->from; trans++)
|
||||
set_bit(trans->to, input->keybit);
|
||||
+
|
||||
+ if (swap_fn_leftctrl) {
|
||||
+ for (trans = swapped_fn_leftctrl_keys; trans->from; trans++)
|
||||
+ set_bit(trans->to, input->keybit);
|
||||
+ }
|
||||
+
|
||||
+ if (rightalt_as_rightctrl) {
|
||||
+ for (trans = rightalt_as_rightctrl_keys; trans->from; trans++)
|
||||
+ set_bit(trans->to, input->keybit);
|
||||
+ }
|
||||
}
|
||||
|
||||
static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi,
|
||||
@@ -370,6 +430,11 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int apple_init_backlight(struct hid_device *hdev);
|
||||
+static int apple_set_backlight(struct hid_device *hdev, u16 value, u16 rate);
|
||||
+static int apple_led_set_backlight(struct led_classdev *led_cdev,
|
||||
+ enum led_brightness brightness);
|
||||
+
|
||||
static int apple_probe(struct hid_device *hdev,
|
||||
const struct hid_device_id *id)
|
||||
{
|
||||
@@ -405,9 +470,107 @@
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ if (quirks & APPLE_BACKLIGHT_CTL)
|
||||
+ apple_init_backlight(hdev);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
+struct apple_backlight_config_report {
|
||||
+ u8 report_id;
|
||||
+ u8 version;
|
||||
+ u16 backlight_off, backlight_on_min, backlight_on_max;
|
||||
+};
|
||||
+struct apple_backlight_set_report {
|
||||
+ u8 report_id;
|
||||
+ u8 version;
|
||||
+ u16 backlight;
|
||||
+ u16 rate;
|
||||
+};
|
||||
+
|
||||
+static bool apple_check_backlight_support(struct hid_device *hdev)
|
||||
+{
|
||||
+ int i;
|
||||
+ unsigned hid;
|
||||
+ struct hid_report *report;
|
||||
+
|
||||
+ list_for_each_entry(report, &hdev->report_enum[HID_INPUT_REPORT].report_list, list) {
|
||||
+ for (i = 0; i < report->maxfield; i++) {
|
||||
+ hid = report->field[i]->usage->hid;
|
||||
+ if ((hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR && (hid & HID_USAGE) == 0xf)
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+static int apple_init_backlight(struct hid_device *hdev)
|
||||
+{
|
||||
+ int ret;
|
||||
+ struct apple_sc *asc = hid_get_drvdata(hdev);
|
||||
+ struct apple_backlight_config_report *rep;
|
||||
+
|
||||
+ if (!apple_check_backlight_support(hdev))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ rep = kmalloc(0x200, GFP_KERNEL);
|
||||
+ ret = hid_hw_raw_request(hdev, 0xBFu, (u8 *) rep, sizeof(*rep), HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
|
||||
+ if (ret < 0) {
|
||||
+ hid_err(hdev, "backlight request failed\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ if (ret < 8 || rep->version != 1) {
|
||||
+ hid_err(hdev, "backlight config struct: bad version %i\n", rep->version);
|
||||
+ kfree(rep);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ hid_dbg(hdev, "backlight config: off=%u, on_min=%u, on_max=%u\n",
|
||||
+ rep->backlight_off, rep->backlight_on_min, rep->backlight_on_max);
|
||||
+
|
||||
+ asc->backlight = devm_kzalloc(&hdev->dev, sizeof(*asc->backlight), GFP_KERNEL);
|
||||
+ if (!asc->backlight) {
|
||||
+ kfree(rep);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ asc->backlight->hdev = hdev;
|
||||
+ asc->backlight->cdev.name = "apple::kbd_backlight";
|
||||
+ asc->backlight->cdev.max_brightness = rep->backlight_on_max;
|
||||
+ asc->backlight->cdev.brightness_set_blocking = apple_led_set_backlight;
|
||||
+ kfree(rep);
|
||||
+
|
||||
+ apple_set_backlight(hdev, 0, 0);
|
||||
+
|
||||
+ return devm_led_classdev_register(&hdev->dev, &asc->backlight->cdev);
|
||||
+}
|
||||
+
|
||||
+static int apple_set_backlight(struct hid_device *hdev, u16 value, u16 rate)
|
||||
+{
|
||||
+ int ret;
|
||||
+ struct apple_backlight_set_report *rep;
|
||||
+
|
||||
+ rep = kmalloc(sizeof(*rep), GFP_KERNEL);
|
||||
+ rep->report_id = 0xB0;
|
||||
+ rep->version = 1;
|
||||
+ rep->backlight = value;
|
||||
+ rep->rate = rate;
|
||||
+
|
||||
+ ret = hid_hw_raw_request(hdev, 0xB0u, (u8 *) rep, sizeof(*rep), HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
|
||||
+ kfree(rep);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int apple_led_set_backlight(struct led_classdev *led_cdev,
|
||||
+ enum led_brightness brightness)
|
||||
+{
|
||||
+ struct apple_sc_backlight *backlight = container_of(led_cdev, struct apple_sc_backlight, cdev);
|
||||
+ return apple_set_backlight(backlight->hdev, brightness, 0);
|
||||
+}
|
||||
+
|
||||
+
|
||||
static const struct hid_device_id apple_devices[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE),
|
||||
.driver_data = APPLE_MIGHTYMOUSE | APPLE_INVERT_HWHEEL },
|
||||
@@ -561,6 +724,16 @@
|
||||
.driver_data = APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS),
|
||||
.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_A),
|
||||
+ .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_B),
|
||||
+ .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_C),
|
||||
+ .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_D),
|
||||
+ .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_E),
|
||||
+ .driver_data = APPLE_HAS_FN | APPLE_BACKLIGHT_CTL },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
|
||||
@@ -0,0 +1,47 @@
|
||||
From: fedora kernel <fedora@kernel.org>
|
||||
Subject: patch keyboard
|
||||
|
||||
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
|
||||
index 76aa474e92c1..52ddbdbaa5fa 100644
|
||||
--- a/drivers/hid/hid-ids.h
|
||||
+++ b/drivers/hid/hid-ids.h
|
||||
@@ -168,6 +168,11 @@
|
||||
#define USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI 0x0272
|
||||
#define USB_DEVICE_ID_APPLE_WELLSPRING9_ISO 0x0273
|
||||
#define USB_DEVICE_ID_APPLE_WELLSPRING9_JIS 0x0274
|
||||
+#define USB_DEVICE_ID_APPLE_WELLSPRING10_T2_A 0x027a
|
||||
+#define USB_DEVICE_ID_APPLE_WELLSPRING10_T2_B 0x027b
|
||||
+#define USB_DEVICE_ID_APPLE_WELLSPRING10_T2_C 0x027c
|
||||
+#define USB_DEVICE_ID_APPLE_WELLSPRING10_T2_D 0x027d
|
||||
+#define USB_DEVICE_ID_APPLE_WELLSPRING10_T2_E 0x0340
|
||||
#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a
|
||||
#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b
|
||||
#define USB_DEVICE_ID_APPLE_IRCONTROL 0x8240
|
||||
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
|
||||
index 4fe2c3ab76f9..4183c9740b13 100644
|
||||
--- a/drivers/hid/hid-quirks.c
|
||||
+++ b/drivers/hid/hid-quirks.c
|
||||
@@ -270,6 +270,11 @@ static const struct hid_device_id hid_have_special_driver[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_A) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_B) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_C) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_D) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_E) },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
|
||||
@@ -911,6 +916,11 @@ static const struct hid_device_id hid_mouse_ignore_list[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_A) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_B) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_C) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_D) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING10_T2_E) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
|
||||
{ }
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user