-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from EffectiveRange/dev
feat: Refactor TI driver to be usable on kernel 6.1.21+
- Loading branch information
Showing
16 changed files
with
1,767 additions
and
609 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
# GitHub recommends pinning actions to a commit SHA. | ||
# To get a newer version, you will need to update the SHA. | ||
# You can also reference a tag or branch, but the action may change without warning. | ||
|
||
name: Release | ||
|
||
on: | ||
push: | ||
branches: main | ||
tags: v*.*.* | ||
|
||
pull_request: | ||
types: | ||
- synchronize | ||
- opened | ||
- reopened | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.sha }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
|
||
create_release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
discussions: write | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- | ||
name: Set up QEMU for multi-architecture builds | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Extract project name | ||
id: extract | ||
run: | | ||
echo proj="$(basename ${{github.workspace}})" >> $GITHUB_OUTPUT | ||
- | ||
name: Build Project | ||
uses: devcontainers/[email protected] | ||
with: | ||
subFolder: "${{github.workspace}}" | ||
configFile: .devcontainer/armhf-container/devcontainer.json | ||
push: never | ||
runCmd: | | ||
make -C "/workspaces/${{steps.extract.outputs.proj}}/" all | ||
- | ||
name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
fail_on_unmatched_files: true | ||
generate_release_notes: true | ||
files: | | ||
build/*.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
build/* | ||
mrhat-*/boot/* | ||
mrhat-*/boot/* | ||
mrhat-*/lib/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,48 @@ | ||
obj-m += bq2562x_charger.o | ||
|
||
KVER ?= $(shell uname -r) | ||
PWD := $(CURDIR) | ||
|
||
all: | ||
make -C /lib/modules/$(KVER)/build M=$(PWD) modules | ||
|
||
clean: | ||
make -C /lib/modules/$(KVER)/build M=$(PWD) clean | ||
|
||
VERSION = $(shell grep Version: mrhat-bq25622/DEBIAN/control | cut -d' ' -f2) | ||
# TODO: build module for all kernel versions | ||
KVER ?= 6.1.21+ | ||
TARGET ?= $(error TARGET not specified for deploy ) | ||
|
||
all: build/mrhat-bq25622_$(VERSION)-1_armhf.deb | ||
@true | ||
|
||
build/mrhat-bq25622_$(VERSION)-1_armhf.deb : build/bq2562x_charger.ko build/mrhat-bq25622.dtbo mrhat-bq25622/DEBIAN/* | ||
mkdir -p build | ||
mkdir -p mrhat-bq25622/lib/modules/$(KVER) | ||
mkdir -p mrhat-bq25622/boot/overlays/ | ||
cp build/bq2562x_charger.ko mrhat-bq25622/lib/modules/$(KVER)/ | ||
cp build/mrhat-bq25622.dtbo mrhat-bq25622/boot/overlays/ | ||
dpkg-deb --root-owner-group --build mrhat-bq25622 build/mrhat-bq25622_$(VERSION)-1_armhf.deb | ||
|
||
build/bq2562x_charger.ko: driver/*.c driver/*.h | ||
mkdir -p build | ||
rsync --delete -r ./driver/ /tmp/drv-bq25622 | ||
schroot -c buildroot -u root -d /tmp/drv-bq25622 -- make KVER=$(KVER) | ||
cp /tmp/drv-bq25622/bq2562x_charger.ko build/bq2562x_charger.ko | ||
|
||
|
||
clean: | ||
rm -rf mrhat-bq25622/boot/ mrhat-bq25622/lib/ build/ | ||
|
||
build/mrhat-bq25622.dts.pre: mrhat-bq25622.dts | ||
mkdir -p build/ | ||
cpp -nostdinc -undef -x assembler-with-cpp -I/var/chroot/buildroot/usr/src/linux-headers-$(KVER)/include -o build/mrhat-bq25622.dts.pre mrhat-bq25622.dts | ||
|
||
build/mrhat-bq25622.dtbo: build/mrhat-bq25622.dts.pre | ||
mkdir -p build/ | ||
dtc -I dts -O dtb -o build/mrhat-bq25622.dtbo build/mrhat-bq25622.dts.pre | ||
|
||
deploy: all | ||
rsync -avhz --progress build/mrhat-bq25622_$(VERSION)-1_armhf.deb $(TARGET):/tmp/ | ||
ssh $(TARGET) -- sudo dpkg -r mrhat-bq25622 | ||
ssh $(TARGET) -- sudo dpkg -i /tmp/mrhat-bq25622_$(VERSION)-1_armhf.deb | ||
|
||
quickdeploy: build/bq2562x_charger.ko | ||
scp build/bq2562x_charger.ko $(TARGET):/tmp/ | ||
ssh $(TARGET) -- sudo cp /tmp/bq2562x_charger.ko /lib/modules/$(KVER)/ | ||
ssh $(TARGET) -- "sudo rmmod bq2562x_charger || true" | ||
ssh $(TARGET) -- "sudo modprobe bq2562x_charger" | ||
|
||
|
||
.PHONY: clean all deploy quickdeploy |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
obj-m += bq2562x_charger.o | ||
|
||
KVER ?= $(shell uname -r) | ||
PWD := $(CURDIR) | ||
|
||
all: | ||
make -C /lib/modules/$(KVER)/build M=$(PWD) modules | ||
|
||
clean: | ||
make -C /lib/modules/$(KVER)/build M=$(PWD) clean |
Oops, something went wrong.