From 4f6acf46765a272de43de53221a618d27a82d65a Mon Sep 17 00:00:00 2001 From: Robert Wolterman Date: Tue, 19 Jul 2016 21:03:40 -0500 Subject: [PATCH] Pull Request #12 fixes for Issue #10. --- CHANGELOG.rst | 7 ++++ README.rst | 9 ++++- overlays/builder.py | 8 ++--- overlays/chip-i2c1.dtbo | Bin 577 -> 0 bytes overlays/chip-i2c1.dts | 2 +- overlays/chip-pwm0.dtbo | Bin 399 -> 0 bytes overlays/chip-pwm0.dts | 2 -- overlays/chip-spi2.dtbo | Bin 1172 -> 0 bytes overlays/chip-spi2.dts | 78 +++++++++++++++++++--------------------- setup.py | 4 +-- source/constants.c | 2 +- 11 files changed, 59 insertions(+), 53 deletions(-) delete mode 100644 overlays/chip-i2c1.dtbo delete mode 100644 overlays/chip-pwm0.dtbo delete mode 100644 overlays/chip-spi2.dtbo diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f8fcd55..2ff7c94 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,10 @@ +0.2.1 +---- +* Pull request #12 fixes: + - Fixed indent in the i2c-1 dts + - Removed import dependencies in the SPI and PWM overlays + - Re-enabled building of the dtbo on setup.py install + 0.2.0 ---- * Added the ability to load DTB Overlays from within CHIP_IO diff --git a/README.rst b/README.rst index 559f0a6..5e76d9d 100644 --- a/README.rst +++ b/README.rst @@ -2,10 +2,17 @@ CHIP_IO ============================ A CHIP GPIO library +NOTE: Now requires the custom DTC to install the library + Manual:: sudo apt-get update - sudo apt-get install git build-essential python-dev python-pip -y + sudo apt-get install git build-essential python-dev python-pip flex bison -y + git clone https://github.com/atenart/dtc + cd dtc + make + sudo make install PREFIX=/usr + cd .. git clone git://github.com/xtacocorex/CHIP_IO.git cd CHIP_IO sudo python setup.py install diff --git a/overlays/builder.py b/overlays/builder.py index bc9a4b2..e4e625c 100644 --- a/overlays/builder.py +++ b/overlays/builder.py @@ -4,8 +4,6 @@ import shutil import glob def compile(): - # The compile needs the include for the spi2 stuff, not enabling that at the moment - # as I don't want to pull in the include section from CHIP-dt-overlays call(["dtc", "-O", "dtb", "-o", "overlays/chip-spi2.dtbo", "-b", "o", "-@", "overlays/chip-spi2.dts"]) call(["dtc", "-O", "dtb", "-o", "overlays/chip-i2c1.dtbo", "-b", "o", "-@", "overlays/chip-i2c1.dts"]) call(["dtc", "-O", "dtb", "-o", "overlays/chip-pwm0.dtbo", "-b", "o", "-@", "overlays/chip-pwm0.dts"]) @@ -15,7 +13,7 @@ def copy(): os.makedirs("/lib/firmware/chip_io/") for fl in glob.glob("/lib/firmware/chip_io/chip-*-.dtbo"): os.remove(fl) - shutil.copy("overlays/chip-spi2.dtbo", "/lib/firmware/chip_io/chip-spi2.dtbo") - shutil.copy("overlays/chip-i2c1.dtbo", "/lib/firmware/chip_io/chip-i2c1.dtbo") - shutil.copy("overlays/chip-pwm0.dtbo", "/lib/firmware/chip_io/chip-pwm0.dtbo") + shutil.move("overlays/chip-spi2.dtbo", "/lib/firmware/chip_io/chip-spi2.dtbo") + shutil.move("overlays/chip-i2c1.dtbo", "/lib/firmware/chip_io/chip-i2c1.dtbo") + shutil.move("overlays/chip-pwm0.dtbo", "/lib/firmware/chip_io/chip-pwm0.dtbo") diff --git a/overlays/chip-i2c1.dtbo b/overlays/chip-i2c1.dtbo deleted file mode 100644 index 45c2402735ce1d98043ce83c40bd94c604d8b33d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 577 zcmZuuu};G<5WN!Dmyb9vaYGyTDVSRJJ9kq`~bheH!w2s z2Z%pF+&M`p5+}X*-t)V=*nZpp{sd@W1HdIf>z&qf!Xe>+z@bQg4%y#NtEOADo^o#F z()+nGvwk*L1)$cC${1<;t~3`avNV9BHMKZfNaIII;9TD!?8T@RI_ZK+J|Xf4X*I5d zV2ORlgl_EeY?P!~!V#-MAcHXxwn4kb@0>K~T)#~?`FMH#qV>Q2yx-$JLgOD$&cS?_ za5a%rEVXYmuDPjuvS){Io8RM#4HWDD5n`&AW#Ovhgnmb~-;LK7k`6uEne@ZzB-P9_ z^4x8B;*EP57RqGa>L{s7npvGJUli!oSWBo{Mnva8mzCB6^l&n<(zz&;T07`D^(5=O W>1uF6&(W|1oJU`}&_$5y1i}wLGIp>4 diff --git a/overlays/chip-i2c1.dts b/overlays/chip-i2c1.dts index c2a2c75..09aa600 100644 --- a/overlays/chip-i2c1.dts +++ b/overlays/chip-i2c1.dts @@ -47,7 +47,7 @@ /plugin/; / { - compatible = "nextthing,chip", "allwinner,sun5i-r8"; + compatible = "nextthing,chip", "allwinner,sun5i-r8"; fragment@0 { target-path = "/aliases"; diff --git a/overlays/chip-pwm0.dtbo b/overlays/chip-pwm0.dtbo deleted file mode 100644 index b0e219e0bbb45bac87ce64654a69b79836374d0a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 399 zcmY*TT}s115T5u0iWF23`Y7UqNK4~GLGq$U=na-JZqlWjP1v2-_7tAPD|iM^;0?qZ zNN2i<)`4$lXXg99nUBHG7eMj~0Qa0{oNpLsj8lfh1NVpV`|nM@ql_AAV)Z9=r$`d#qsZt{0XM(9gTS-dFjyk^dHhcnr^ sD{G9)$=h)nCH=1BysjD~^JFzdOX!&nD;<8T6apc&+*nqER535W2J>cANdN!< diff --git a/overlays/chip-pwm0.dts b/overlays/chip-pwm0.dts index 1ae213c..a25abb0 100644 --- a/overlays/chip-pwm0.dts +++ b/overlays/chip-pwm0.dts @@ -45,8 +45,6 @@ /dts-v1/; /plugin/; -#include - / { compatible = "nextthing,chip", "allwinner,sun5i-r8"; diff --git a/overlays/chip-spi2.dtbo b/overlays/chip-spi2.dtbo deleted file mode 100644 index 91828fa29afc2b9910b9d418ed3e36a9624c57b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1172 zcmbtUy^ho{5T4}@3B-?}Ku9!5tb`~w+T9?~aTU!KbXQVg`4VSi;W)u|mfaH%zyly^ zItt(s;0Y*r0w`!`5O08(asIrKpuy6t{Y}34@yvL?T>AYJVE+{W902US$Ndh3>Low0H)jN)6yh%m90j05gP)LlP5TEg*BjB=MabH4Elx^hn_g2cH&H&$has5<^DrOH!W6lm|HTb@M{#ksRGDzaGP$X%HYn-) za7~@ZGZ@wg>3&{E_t^1B{2M6Wg4_-rH!IN@^Rxtk#K>r4Cf7k!um)s#Xe=)b(ao -#include - /plugin/; / { - compatible = "nextthing,chip", "allwinner,sun5i-r8"; + compatible = "nextthing,chip", "allwinner,sun5i-r8"; - /* activate the gpio for interrupt */ - fragment@0 { - target-path = <&pio>; + /* activate the gpio for interrupt */ + fragment@0 { + target-path = <&pio>; - __overlay__ { - chip_spi2_pins: spi2@0 { - allwinner,pins = "PE1", "PE2", "PE3"; - allwinner,function = "spi2"; - allwinner,drive = ; - allwinner,pull = ; - }; + __overlay__ { + chip_spi2_pins: spi2@0 { + allwinner,pins = "PE1", "PE2", "PE3"; + allwinner,function = "spi2"; + allwinner,drive = "0"; //; + allwinner,pull = "0"; //; + }; - chip_spi2_cs0_pins: spi2_cs0@0 { - allwinner,pins = "PE0"; - allwinner,function = "spi2"; - allwinner,drive = ; - allwinner,pull = ; - }; - }; + chip_spi2_cs0_pins: spi2_cs0@0 { + allwinner,pins = "PE0"; + allwinner,function = "spi2"; + allwinner,drive = "0"; //; + allwinner,pull = "0"; //; + }; }; + }; - /* - * Enable our SPI device, with an spidev device connected - * to it - */ - fragment@1 { - target = <&spi2>; + /* + * Enable our SPI device, with an spidev device connected + * to it + */ + fragment@1 { + target = <&spi2>; - __overlay__ { - #address-cells = <1>; - #size-cells = <0>; - pinctrl-names = "default"; - pinctrl-0 = <&chip_spi2_pins>, <&chip_spi2_cs0_pins>; - status = "okay"; + __overlay__ { + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&chip_spi2_pins>, <&chip_spi2_cs0_pins>; + status = "okay"; - spi2@0 { - //compatible = "spidev"; - compatible = "rohm,dh2228fv"; - reg = <0>; - spi-max-frequency = <24000000>; - }; - }; + spi2@0 { + compatible = "rohm,dh2228fv"; + reg = <0>; + spi-max-frequency = <24000000>; + }; }; + }; }; + diff --git a/setup.py b/setup.py index c95942a..4cb737a 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ try: from overlays import builder - #builder.compile() + builder.compile() builder.copy() except: pass @@ -20,7 +20,7 @@ classifiers = ['Development Status :: 3 - Alpha', 'Topic :: System :: Hardware'] setup(name = 'CHIP_IO', - version = '0.2.0', + version = '0.2.1', author = 'Robert Wolterman', author_email = 'robert.wolterman@gmail.com', description = 'A module to control CHIP IO channels', diff --git a/source/constants.c b/source/constants.c index 6df746a..e7a481e 100644 --- a/source/constants.c +++ b/source/constants.c @@ -76,6 +76,6 @@ void define_constants(PyObject *module) both_edge = Py_BuildValue("i", BOTH_EDGE); PyModule_AddObject(module, "BOTH", both_edge); - version = Py_BuildValue("s", "0.2.0"); + version = Py_BuildValue("s", "0.2.1"); PyModule_AddObject(module, "VERSION", version); }