diff --git a/arch/powerpc/boot/dts/powerpc-quanta-ly2r-r0.dts b/arch/powerpc/boot/dts/powerpc-quanta-ly2r-r0.dts
new file mode 100644
index 00000000..36ad4f0f
--- /dev/null
+++ b/arch/powerpc/boot/dts/powerpc-quanta-ly2r-r0.dts
@@ -0,0 +1,1479 @@
+/*
+ *
+ *
+ * Copyright 2013, 2014 BigSwitch Networks, Inc.
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms ofthe GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ *
+ *
+ *
+ *
+ * Device tree for the Quanta LY2.
+ *
+ */
+
+
+/dts-v1/;
+
+/ {
+ model = "powerpc-quanta-ly2r-r0";
+ compatible = "fsl,P2020RDB";
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ aliases {
+ ethernet0 = &enet0;
+ serial0 = &serial0;
+ serial1 = &serial1;
+ pci2 = &pci2;
+ mpic-msgr-block0 = &mpic_msgr_block0;
+ mpic-msgr-block1 = &mpic_msgr_block1;
+ };
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ PowerPC,P2020@0 {
+ device_type = "cpu";
+ reg = <0x0>;
+ next-level-cache = <&l2>;
+ };
+
+ PowerPC,P2020@1 {
+ device_type = "cpu";
+ reg = <0x1>;
+ next-level-cache = <&l2>;
+ };
+ };
+
+ memory {
+ device_type = "memory";
+ };
+
+ localbus@ffe05000 {
+ #address-cells = <2>;
+ #size-cells = <1>;
+ compatible = "fsl,p2020-elbc", "fsl,elbc", "simple-bus";
+ reg = <0 0xffe05000 0 0x1000>;
+ interrupts = <19 2>;
+ interrupt-parent = <&mpic>;
+
+ ranges = <0x0 0x0 0x0 0xec000000 0x4000000
+ 0x1 0x0 0x0 0xe8000000 0x4000000>;
+
+ flash@0,0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "cfi-flash";
+ reg = <0x0 0x0 0x4000000>;
+ bank-width = <2>;
+
+ /*
+ * ONIE flash layout (reverse-engineered:
+ * - one ~59MiB loader partition
+ * - 4 MiB onie partition
+ * - uboot-env and uboot
+ * - 64MiB leftover space for jffs2
+ *
+ */
+
+ flash@0 {
+ label = "onl-loader";
+ reg = <0x00000000 0x03b60000>;
+ };
+
+ flash@1 {
+ label = "onie";
+ reg = <0x03b60000 0x00400000>;
+ read-only;
+ };
+
+ flash@2 {
+ label = "uboot-env";
+ reg = <0x03f60000 0x00020000>;
+ };
+
+ flash@3 {
+ label = "uboot";
+ reg = <0x03f80000 0x00080000>;
+ read-only;
+ };
+
+ };
+
+ flash@1,0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "cfi-flash";
+ reg = <0x1 0x0 0x4000000>;
+ bank-width = <2>;
+
+ flash@4 {
+ label = "mnt-flash";
+ reg = <0x00000000 0x04000000>;
+ };
+ };
+ };
+
+ soc@ffe00000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ device_type = "soc";
+ compatible = "fsl,p2020-immr", "simple-bus";
+ ranges = <0x0 0x0 0xffe00000 0x100000>;
+ bus-frequency = <0>;
+
+ ecm-law@0 {
+ compatible = "fsl,ecm-law";
+ reg = <0x0 0x1000>;
+ fsl,num-laws = <12>;
+ };
+
+ ecm@1000 {
+ compatible = "fsl,p2020-ecm", "fsl,ecm";
+ reg = <0x1000 0x1000>;
+ interrupts = <17 2>;
+ interrupt-parent = <&mpic>;
+ };
+
+ memory-controller@2000 {
+ compatible = "fsl,p2020-memory-controller";
+ reg = <0x2000 0x1000>;
+ interrupt-parent = <&mpic>;
+ interrupts = <18 2>;
+ };
+
+ i2c@3000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ cell-index = <0>;
+ compatible = "fsl-i2c";
+ reg = <0x3000 0x100>;
+ interrupts = <43 2>;
+ interrupt-parent = <&mpic>;
+ dfsrr;
+
+ dimm@51 {
+ compatible = "at,spd";
+ reg = <0x51>;
+ read-only;
+ };
+
+ rtc@68 {
+ compatible = "dallas,ds1338";
+ reg = <0x68>;
+ };
+
+ eeprom-mb@54 {
+ compatible = "at,24c02";
+ reg = <0x54>;
+ read-only;
+ };
+
+ temp-fan@2e {
+ compatible = "quanta_ly2r_hwmon";
+ reg = <0x2e>;
+ };
+
+ gpio-fan-cpld@26 {
+ compatible = "nxp,pca9555";
+ reg = <0x26>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ };
+
+ mux@75 {
+ compatible = "nxp,pca9546";
+ reg = <0x75>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ i2c@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ psu-1@58 {
+ compatible = "pmbus";
+ reg = <0x58>;
+ };
+ };
+
+ i2c@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+
+ psu-2@59 {
+ compatible = "pmbus";
+ reg = <0x59>;
+ };
+ };
+
+ i2c@2 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <2>;
+
+ gpio-psu-1@24 {
+ compatible = "nxp,pca9555";
+ reg = <0x24>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ };
+ };
+
+ i2c@3 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <3>;
+
+ gpio-psu-2@25 {
+ compatible = "nxp,pca9555";
+ reg = <0x25>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ };
+ };
+ };
+ };
+
+ i2c@3100 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ cell-index = <1>;
+ compatible = "fsl-i2c";
+ reg = <0x3100 0x100>;
+ interrupts = <43 2>;
+ interrupt-parent = <&mpic>;
+ dfsrr;
+
+ gpio-qsfp@21 {
+ compatible = "nxp,pca9698";
+ reg = <0x21>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ };
+
+ mux@72 {
+ compatible = "nxp,pca9546";
+ reg = <0x72>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ i2c@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ mux@38 {
+ compatible = "quanta_ly2r_i2c_mux";
+ reg = <0x38>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ i2c@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ eeprom-sfp-1@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-1@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+
+ eeprom-sfp-2@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-2@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@2 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <2>;
+
+ eeprom-sfp-3@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-3@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@3 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <3>;
+
+ eeprom-sfp-4@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-4@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@4 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <4>;
+
+ eeprom-sfp-5@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-5@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@5 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <5>;
+
+ eeprom-sfp-6@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-6@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@6 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <6>;
+
+ eeprom-sfp-7@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-7@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@7 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <7>;
+
+ eeprom-sfp-8@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-8@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@8 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <8>;
+
+ eeprom-sfp-9@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-9@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@9 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <9>;
+
+ eeprom-sfp-10@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-10@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@10 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <10>;
+
+ eeprom-sfp-11@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-11@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@11 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <11>;
+
+ eeprom-sfp-12@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-12@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@12 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <12>;
+
+ eeprom-sfp-13@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-13@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@13 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <13>;
+
+ eeprom-sfp-14@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-14@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@14 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <14>;
+
+ eeprom-sfp-15@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-15@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@15 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <15>;
+
+ eeprom-sfp-16@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-16@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@16 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <16>;
+
+ eeprom-sfp-17@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-17@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@17 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <17>;
+
+ eeprom-sfp-18@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-18@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@18 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <18>;
+
+ eeprom-sfp-19@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-19@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@19 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <19>;
+
+ eeprom-sfp-20@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-20@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@20 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <20>;
+
+ eeprom-sfp-21@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-21@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@21 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <21>;
+
+ eeprom-sfp-22@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-22@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@22 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <22>;
+
+ eeprom-sfp-23@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-23@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@23 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <23>;
+
+ eeprom-sfp-24@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-24@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@24 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <24>;
+
+ eeprom-sfp-25@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-25@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@25 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <25>;
+
+ eeprom-sfp-26@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-26@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@26 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <26>;
+
+ eeprom-sfp-27@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-27@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@27 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <27>;
+
+ eeprom-sfp-28@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-28@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@28 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <28>;
+
+ eeprom-sfp-29@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-29@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@29 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <29>;
+
+ eeprom-sfp-30@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-30@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@30 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <30>;
+
+ eeprom-sfp-31@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-31@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@31 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <31>;
+
+ eeprom-sfp-32@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-32@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+ };
+
+ mux@39 {
+ compatible = "quanta_ly2r_i2c_mux";
+ reg = <0x39>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ i2c@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ eeprom-sfp-33@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-33@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+
+ eeprom-sfp-34@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-34@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@2 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <2>;
+
+ eeprom-sfp-35@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-35@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@3 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <3>;
+
+ eeprom-sfp-36@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-36@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@4 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <4>;
+
+ eeprom-sfp-37@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-37@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@5 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <5>;
+
+ eeprom-sfp-38@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-38@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@6 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <6>;
+
+ eeprom-sfp-39@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-39@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@7 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <7>;
+
+ eeprom-sfp-40@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-40@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@8 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <8>;
+
+ eeprom-sfp-41@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-41@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@9 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <9>;
+
+ eeprom-sfp-42@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-42@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@10 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <10>;
+
+ eeprom-sfp-43@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-43@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@11 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <11>;
+
+ eeprom-sfp-44@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-44@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@12 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <12>;
+
+ eeprom-sfp-45@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-45@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@13 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <13>;
+
+ eeprom-sfp-46@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-46@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@14 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <14>;
+
+ eeprom-sfp-47@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-47@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@15 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <15>;
+
+ eeprom-sfp-48@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-sfp-48@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@16 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <16>;
+
+ eeprom-qsfp-1@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-qsfp-1@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@17 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <17>;
+
+ eeprom-qsfp-2@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-qsfp-2@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@18 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <18>;
+
+ eeprom-qsfp-3@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-qsfp-3@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+
+ i2c@19 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <19>;
+
+ eeprom-qsfp-4@50 {
+ compatible = "at,24c02";
+ reg = <0x50>;
+ read-only;
+ };
+ eeprom-qsfp-4@51 {
+ compatible = "at,24c02";
+ reg = <0x51>;
+ read-only;
+ };
+ };
+ };
+ };
+
+ i2c@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+
+ cpld@3a {
+ compatible = "quanta_ly2r_cpld";
+ reg = <0x3a>;
+ };
+
+ cpld@3b {
+ compatible = "quanta_ly2r_cpld";
+ reg = <0x3b>;
+ };
+
+ cpld@3c {
+ compatible = "quanta_ly2r_cpld";
+ reg = <0x3c>;
+ };
+ };
+
+ i2c@2 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <2>;
+ };
+
+ i2c@3 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <3>;
+ };
+ };
+ };
+
+ serial0: serial@4500 {
+ cell-index = <0>;
+ device_type = "serial";
+ compatible = "ns16550";
+ reg = <0x4500 0x100>;
+ clock-frequency = <0>;
+ interrupts = <42 2>;
+ interrupt-parent = <&mpic>;
+ };
+
+ serial1: serial@4600 {
+ cell-index = <1>;
+ device_type = "serial";
+ compatible = "ns16550";
+ reg = <0x4600 0x100>;
+ clock-frequency = <0>;
+ interrupts = <42 2>;
+ interrupt-parent = <&mpic>;
+ };
+
+ dma@c300 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "fsl,eloplus-dma";
+ reg = <0xc300 0x4>;
+ ranges = <0x0 0xc100 0x200>;
+ cell-index = <1>;
+ dma-channel@0 {
+ compatible = "fsl,eloplus-dma-channel";
+ reg = <0x0 0x80>;
+ cell-index = <0>;
+ interrupt-parent = <&mpic>;
+ interrupts = <76 2>;
+ };
+ dma-channel@80 {
+ compatible = "fsl,eloplus-dma-channel";
+ reg = <0x80 0x80>;
+ cell-index = <1>;
+ interrupt-parent = <&mpic>;
+ interrupts = <77 2>;
+ };
+ dma-channel@100 {
+ compatible = "fsl,eloplus-dma-channel";
+ reg = <0x100 0x80>;
+ cell-index = <2>;
+ interrupt-parent = <&mpic>;
+ interrupts = <78 2>;
+ };
+ dma-channel@180 {
+ compatible = "fsl,eloplus-dma-channel";
+ reg = <0x180 0x80>;
+ cell-index = <3>;
+ interrupt-parent = <&mpic>;
+ interrupts = <79 2>;
+ };
+ };
+
+ gpio: gpio-controller@f000 {
+ #gpio-cells = <2>;
+ compatible = "fsl,mpc8572-gpio";
+ reg = <0xf000 0x100>;
+ interrupts = <47 0x2>;
+ interrupt-parent = <&mpic>;
+ gpio-controller;
+ };
+
+ l2: l2-cache-controller@20000 {
+ compatible = "fsl,p2020-l2-cache-controller";
+ reg = <0x20000 0x1000>;
+ cache-line-size = <32>; // 32 bytes
+ cache-size = <0x80000>; // L2,512K
+ interrupt-parent = <&mpic>;
+ interrupts = <16 2>;
+ };
+
+ dma@21300 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "fsl,eloplus-dma";
+ reg = <0x21300 0x4>;
+ ranges = <0x0 0x21100 0x200>;
+ cell-index = <0>;
+ dma-channel@0 {
+ compatible = "fsl,eloplus-dma-channel";
+ reg = <0x0 0x80>;
+ cell-index = <0>;
+ interrupt-parent = <&mpic>;
+ interrupts = <20 2>;
+ };
+ dma-channel@80 {
+ compatible = "fsl,eloplus-dma-channel";
+ reg = <0x80 0x80>;
+ cell-index = <1>;
+ interrupt-parent = <&mpic>;
+ interrupts = <21 2>;
+ };
+ dma-channel@100 {
+ compatible = "fsl,eloplus-dma-channel";
+ reg = <0x100 0x80>;
+ cell-index = <2>;
+ interrupt-parent = <&mpic>;
+ interrupts = <22 2>;
+ };
+ dma-channel@180 {
+ compatible = "fsl,eloplus-dma-channel";
+ reg = <0x180 0x80>;
+ cell-index = <3>;
+ interrupt-parent = <&mpic>;
+ interrupts = <23 2>;
+ };
+ };
+
+/* usb@22000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "fsl-usb2-dr";
+ reg = <0x22000 0x1000>;
+ interrupt-parent = <&mpic>;
+ interrupts = <28 0x2>;
+ phy_type = "ulpi";
+ };
+*/
+ ptp_timer: ptimer@24e00 {
+ compatible = "fsl,gianfar-ptp-timer";
+ reg = <0x24e00 0xb0>;
+ };
+
+ enet0: ethernet@24000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ cell-index = <0>;
+ device_type = "network";
+ model = "eTSEC";
+ compatible = "gianfar";
+ reg = <0x24000 0x1000>;
+ ranges = <0x0 0x24000 0x1000>;
+ local-mac-address = [ 00 00 00 00 00 00 ];
+ interrupts = <29 2 30 2 34 2>;
+ interrupt-parent = <&mpic>;
+ phy-connection-type = "sgmii";
+ phy-handle = <&phy0>;
+ tbi-handle = <&tbi0>;
+ };
+
+ mdio@24520 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "fsl,gianfar-mdio";
+ reg = <0x24520 0x20>;
+
+ phy0: ethernet-phy@0 {
+ reg = <0x1>;
+ device_type = "ethernet-phy";
+ };
+ tbi0: tbi-phy@11 {
+ reg = <0x11>;
+ device_type = "tbi-phy";
+ };
+ };
+
+ sdhci@2e000 {
+ compatible = "fsl,p2020-esdhc", "fsl,esdhc";
+ reg = <0x2e000 0x1000>;
+ interrupts = <72 0x2>;
+ interrupt-parent = <&mpic>;
+ clock-frequency = <0>;
+ };
+
+ crypto@30000 {
+ compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4",
+ "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0";
+ reg = <0x30000 0x10000>;
+ interrupts = <45 2 58 2>;
+ interrupt-parent = <&mpic>;
+ fsl,num-channels = <4>;
+ fsl,channel-fifo-len = <24>;
+ fsl,exec-units-mask = <0xbfe>;
+ fsl,descriptor-types-mask = <0x3ab0ebf>;
+ fsl,multi-host-mode = "dual";
+ fsl,channel-remap = <0x3>;
+ };
+
+ mpic: pic@40000 {
+ interrupt-controller;
+ #address-cells = <0>;
+ #interrupt-cells = <2>;
+ reg = <0x40000 0x40000>;
+ compatible = "chrp,open-pic";
+ device_type = "open-pic";
+ };
+
+ mpic_msgr_block0: message@41400 {
+ compatible = "fsl,mpic-v3.1-msgr";
+ reg = <0x41400 0x200>;
+ interrupts = <
+ 0xb0 2
+ 0xb1 2
+ 0xb2 2
+ 0xb3 2>;
+ interrupt-parent = <&mpic>;
+ };
+
+ mpic_msgr_block1: message@42400 {
+ compatible = "fsl,mpic-v3.1-msgr";
+ reg = <0x42400 0x200>;
+ interrupts = <
+ 0xb4 2
+ 0xb5 2
+ 0xb6 2
+ 0xb7 2>;
+ interrupt-parent = <&mpic>;
+ };
+
+ msi@41600 {
+ compatible = "fsl,p2020-msi", "fsl,mpic-msi";
+ reg = <0x41600 0x80>;
+ msi-available-ranges = <0 0x100>;
+ interrupts = <
+ 0xe0 0
+ 0xe1 0
+ 0xe2 0
+ 0xe3 0
+ 0xe4 0
+ 0xe5 0
+ 0xe6 0
+ 0xe7 0>;
+ interrupt-parent = <&mpic>;
+ };
+
+ global-utilities@e0000 {
+ compatible = "fsl,p2020-guts";
+ reg = <0xe0000 0x1000>;
+ fsl,has-rstcr;
+ };
+ };
+
+ pci2: pcie@ffe0a000 {
+ compatible = "fsl,mpc8548-pcie";
+ device_type = "pci";
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ reg = <0 0xffe0a000 0 0x1000>;
+ bus-range = <0 255>;
+ ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
+ 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
+ clock-frequency = <100000000>;
+ interrupt-parent = <&mpic>;
+ interrupts = <26 2>;
+ interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
+ interrupt-map = <
+ /* IDSEL 0x0 */
+ 0000 0x0 0x0 0x1 &mpic 0x0 0x1
+ 0000 0x0 0x0 0x2 &mpic 0x1 0x1
+ 0000 0x0 0x0 0x3 &mpic 0x2 0x1
+ 0000 0x0 0x0 0x4 &mpic 0x3 0x1
+ >;
+ pcie@0 {
+ reg = <0x0 0x0 0x0 0x0 0x0>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ device_type = "pci";
+ ranges = <0x2000000 0x0 0xc0000000
+ 0x2000000 0x0 0xc0000000
+ 0x0 0x20000000
+
+ 0x1000000 0x0 0x0
+ 0x1000000 0x0 0x0
+ 0x0 0x10000>;
+ };
+ };
+};
diff --git a/arch/powerpc/configs/85xx/onl_mpc85xx_defconfig b/arch/powerpc/configs/85xx/onl_mpc85xx_defconfig
index 1fc0e957..a3d7ac3a 100644
--- a/arch/powerpc/configs/85xx/onl_mpc85xx_defconfig
+++ b/arch/powerpc/configs/85xx/onl_mpc85xx_defconfig
@@ -1177,9 +1177,11 @@ CONFIG_I2C_MUX=y
# Multiplexer I2C Chip support
#
# CONFIG_I2C_MUX_GPIO is not set
+CONFIG_ARCH_NR_GPIOS=512
# CONFIG_I2C_MUX_PCA9541 is not set
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_MUX_QUANTA_LY2=y
+CONFIG_I2C_MUX_QUANTA_LY2R=y
CONFIG_I2C_MUX_QUANTA_LY5=y
CONFIG_I2C_HELPER_AUTO=y
@@ -1459,6 +1461,7 @@ CONFIG_SENSORS_EMC2305=y
# CONFIG_SENSORS_W83L785TS is not set
# CONFIG_SENSORS_W83L786NG is not set
CONFIG_SENSORS_QUANTA_LY_HWMON=y
+CONFIG_SENSORS_QUANTA_LY2R_HWMON=y
# CONFIG_THERMAL is not set
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_CORE=y
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 9391cf16..b29d94a5 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -59,6 +59,7 @@ static const struct i2c_device_id pca953x_id[] = {
{ "pca9557", 8 | PCA953X_TYPE, },
{ "pca9574", 8 | PCA957X_TYPE | PCA_INT, },
{ "pca9575", 16 | PCA957X_TYPE | PCA_INT, },
+ { "pca9698", 40 | PCA953X_TYPE, },
{ "max7310", 8 | PCA953X_TYPE, },
{ "max7312", 16 | PCA953X_TYPE | PCA_INT, },
@@ -309,7 +310,7 @@ static int pca953x_gpio_get_value(struct gpio_chip *gc, unsigned off)
return 0;
}
- return (reg_val & (1u << off)) ? 1 : 0;
+ return (reg_val & (1u << (off % BANK_SZ))) ? 1 : 0;
}
static void pca953x_gpio_set_value(struct gpio_chip *gc, unsigned off, int val)
@@ -824,6 +825,7 @@ static const struct of_device_id pca953x_dt_ids[] = {
{ .compatible = "nxp,pca9557", },
{ .compatible = "nxp,pca9574", },
{ .compatible = "nxp,pca9575", },
+ { .compatible = "nxp,pca9698", },
{ .compatible = "maxim,max7310", },
{ .compatible = "maxim,max7312", },
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 9d5a0ddd..a8e3fe0a 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1489,6 +1489,13 @@ config SENSORS_QUANTA_LY_HWMON
If you say yes here you get support for the Quanta LYx hardware
monitor.
+config SENSORS_QUANTA_LY2R_HWMON
+ tristate "Quanta LY2R hardware monitor"
+ depends on I2C
+ help
+ If you say yes here you get support for the Quanta LY2R hardware
+ monitor.
+
if ACPI
comment "ACPI drivers"
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index 956c9051..40ebdbed 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -137,6 +137,7 @@ obj-$(CONFIG_SENSORS_W83L786NG) += w83l786ng.o
obj-$(CONFIG_SENSORS_WM831X) += wm831x-hwmon.o
obj-$(CONFIG_SENSORS_WM8350) += wm8350-hwmon.o
obj-$(CONFIG_SENSORS_QUANTA_LY_HWMON) += quanta-ly-hwmon.o
+obj-$(CONFIG_SENSORS_QUANTA_LY2R_HWMON) += quanta-ly2r-hwmon.o
obj-$(CONFIG_PMBUS) += pmbus/
diff --git a/drivers/hwmon/quanta-ly2r-hwmon.c b/drivers/hwmon/quanta-ly2r-hwmon.c
new file mode 100644
index 00000000..86a60744
--- /dev/null
+++ b/drivers/hwmon/quanta-ly2r-hwmon.c
@@ -0,0 +1,234 @@
+/*
+ *
+ *
+ * Copyright 2013, 2014 BigSwitch Networks, Inc.
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms ofthe GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ *
+ *
+ *
+ * A hwmon driver for the Quanta LYx
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+static const unsigned short normal_i2c[] = { 0x2E, I2C_CLIENT_END };
+
+#define QUANTA_LY2R_HWMON_REG_TEMP_INPUT_BASE 0x30
+#define QUANTA_LY2R_HWMON_REG_FAN_MODE 0x55
+#define QUANTA_LY2R_HWMON_REG_FAN_DIR 0x56
+#define QUANTA_LY2R_HWMON_REG_FAN_PWM_BASE 0x60
+#define QUANTA_LY2R_HWMON_REG_FAN_INPUT_BASE 0x80
+
+#define QUANTA_LY2R_HWMON_FAN_MANUAL_MODE 1
+#define QUANTA_LY2R_HWMON_FAN_AUTO_MODE 2
+
+#define QUANTA_LY2R_HWMON_NUM_FANS 8
+
+struct quanta_ly2r_hwmon_data {
+ struct device *hwmon_dev;
+ struct attribute_group attrs;
+ struct mutex lock;
+};
+
+static int quanta_ly2r_hwmon_probe(struct i2c_client *client,
+ const struct i2c_device_id *id);
+static int quanta_ly2r_hwmon_remove(struct i2c_client *client);
+
+static const struct i2c_device_id quanta_ly2r_hwmon_id[] = {
+ { "quanta_ly2r_hwmon", 0xf2f0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, quanta_ly2r_hwmon_id);
+
+static struct i2c_driver quanta_ly2r_hwmon_driver = {
+ .class = I2C_CLASS_HWMON,
+ .driver = {
+ .name = "quanta_ly2r_hwmon",
+ },
+ .probe = quanta_ly2r_hwmon_probe,
+ .remove = quanta_ly2r_hwmon_remove,
+ .id_table = quanta_ly2r_hwmon_id,
+ .address_list = normal_i2c,
+};
+
+static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
+ char *buf)
+{
+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+ struct i2c_client *client = to_i2c_client(dev);
+ struct quanta_ly2r_hwmon_data *data = i2c_get_clientdata(client);
+ int temp;
+
+ mutex_lock(&data->lock);
+ temp = i2c_smbus_read_byte_data(client,
+ QUANTA_LY2R_HWMON_REG_TEMP_INPUT_BASE
+ + attr->index);
+ mutex_unlock(&data->lock);
+ return sprintf(buf, "%d\n", 1000 * temp);
+}
+
+static ssize_t show_fan(struct device *dev, struct device_attribute *devattr,
+ char *buf)
+{
+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+ struct i2c_client *client = to_i2c_client(dev);
+ struct quanta_ly2r_hwmon_data *data = i2c_get_clientdata(client);
+ int fan;
+
+ mutex_lock(&data->lock);
+ fan = i2c_smbus_read_word_swapped(client,
+ QUANTA_LY2R_HWMON_REG_FAN_INPUT_BASE
+ + 2 * attr->index);
+ mutex_unlock(&data->lock);
+ return sprintf(buf, "%d\n", fan);
+}
+
+static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr,
+ char *buf)
+{
+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+ struct i2c_client *client = to_i2c_client(dev);
+ struct quanta_ly2r_hwmon_data *data = i2c_get_clientdata(client);
+ int pwm;
+
+ mutex_lock(&data->lock);
+ pwm = i2c_smbus_read_word_swapped(client,
+ QUANTA_LY2R_HWMON_REG_FAN_PWM_BASE
+ + 2 * attr->index);
+ mutex_unlock(&data->lock);
+ return sprintf(buf, "%d\n", pwm * 255 / 10000);
+}
+
+static ssize_t set_pwm(struct device *dev, struct device_attribute *devattr,
+ const char *buf, size_t count)
+{
+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+ struct i2c_client *client = to_i2c_client(dev);
+ struct quanta_ly2r_hwmon_data *data = i2c_get_clientdata(client);
+ long val;
+ int ret;
+
+ ret = kstrtol(buf, 10, &val);
+ if (ret)
+ return ret;
+ mutex_lock(&data->lock);
+ i2c_smbus_write_word_swapped(client,
+ QUANTA_LY2R_HWMON_REG_FAN_PWM_BASE
+ + 2 * attr->index, val * 10000 / 255);
+ mutex_unlock(&data->lock);
+ return count;
+}
+
+static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL, 0);
+static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_temp, NULL, 1);
+static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, show_temp, NULL, 2);
+static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_temp, NULL, 3);
+static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan, NULL, 0);
+static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan, NULL, 1);
+static SENSOR_DEVICE_ATTR(fan3_input, S_IRUGO, show_fan, NULL, 2);
+static SENSOR_DEVICE_ATTR(fan5_input, S_IRUGO, show_fan, NULL, 4);
+static SENSOR_DEVICE_ATTR(fan6_input, S_IRUGO, show_fan, NULL, 5);
+static SENSOR_DEVICE_ATTR(fan7_input, S_IRUGO, show_fan, NULL, 6);
+static SENSOR_DEVICE_ATTR(pwm1, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 0);
+static SENSOR_DEVICE_ATTR(pwm2, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 1);
+static SENSOR_DEVICE_ATTR(pwm3, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 2);
+static SENSOR_DEVICE_ATTR(pwm4, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 3);
+static SENSOR_DEVICE_ATTR(pwm5, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 4);
+static SENSOR_DEVICE_ATTR(pwm6, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 5);
+static SENSOR_DEVICE_ATTR(pwm7, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 6);
+static SENSOR_DEVICE_ATTR(pwm8, S_IWUSR | S_IRUGO, show_pwm, set_pwm, 7);
+
+static struct attribute *quanta_ly2r_hwmon_attr[] = {
+ &sensor_dev_attr_temp1_input.dev_attr.attr,
+ &sensor_dev_attr_temp2_input.dev_attr.attr,
+ &sensor_dev_attr_temp3_input.dev_attr.attr,
+ &sensor_dev_attr_temp4_input.dev_attr.attr,
+ &sensor_dev_attr_fan1_input.dev_attr.attr,
+ &sensor_dev_attr_fan2_input.dev_attr.attr,
+ &sensor_dev_attr_fan3_input.dev_attr.attr,
+ &sensor_dev_attr_fan5_input.dev_attr.attr,
+ &sensor_dev_attr_fan6_input.dev_attr.attr,
+ &sensor_dev_attr_fan7_input.dev_attr.attr,
+ &sensor_dev_attr_pwm1.dev_attr.attr,
+ &sensor_dev_attr_pwm2.dev_attr.attr,
+ &sensor_dev_attr_pwm3.dev_attr.attr,
+ &sensor_dev_attr_pwm4.dev_attr.attr,
+ &sensor_dev_attr_pwm5.dev_attr.attr,
+ &sensor_dev_attr_pwm6.dev_attr.attr,
+ &sensor_dev_attr_pwm7.dev_attr.attr,
+ &sensor_dev_attr_pwm8.dev_attr.attr,
+ NULL
+};
+
+static int quanta_ly2r_hwmon_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct quanta_ly2r_hwmon_data *data;
+ int err;
+ int i;
+
+ data = devm_kzalloc(&client->dev, sizeof(struct quanta_ly2r_hwmon_data),
+ GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ i2c_set_clientdata(client, data);
+ mutex_init(&data->lock);
+
+ dev_info(&client->dev, "%s chip found\n", client->name);
+
+ data->attrs.attrs = quanta_ly2r_hwmon_attr;
+ err = sysfs_create_group(&client->dev.kobj, &data->attrs);
+ if (err)
+ return err;
+
+ data->hwmon_dev = hwmon_device_register(&client->dev);
+ if (IS_ERR(data->hwmon_dev)) {
+ err = PTR_ERR(data->hwmon_dev);
+ goto exit_remove;
+ }
+
+ i2c_smbus_write_byte_data(client,
+ QUANTA_LY2R_HWMON_REG_FAN_MODE,
+ QUANTA_LY2R_HWMON_FAN_MANUAL_MODE);
+ for (i = 0; i < QUANTA_LY2R_HWMON_NUM_FANS; i++) {
+ u8 cmd = QUANTA_LY2R_HWMON_REG_FAN_PWM_BASE + i * 2;
+ i2c_smbus_write_word_swapped(client, cmd, 10000);
+ }
+
+ return 0;
+
+exit_remove:
+ sysfs_remove_group(&client->dev.kobj, &data->attrs);
+ return err;
+}
+
+static int quanta_ly2r_hwmon_remove(struct i2c_client *client)
+{
+ struct quanta_ly2r_hwmon_data *data = i2c_get_clientdata(client);
+
+ hwmon_device_unregister(data->hwmon_dev);
+ sysfs_remove_group(&client->dev.kobj, &data->attrs);
+ return 0;
+}
+
+module_i2c_driver(quanta_ly2r_hwmon_driver);
+
+MODULE_AUTHOR("QCT Technical ");
+MODULE_DESCRIPTION("Quanta LY2R hardware monitor driver");
+MODULE_LICENSE("LGPL");
diff --git a/drivers/i2c/muxes/Kconfig b/drivers/i2c/muxes/Kconfig
index c70f50a3..54da14da 100644
--- a/drivers/i2c/muxes/Kconfig
+++ b/drivers/i2c/muxes/Kconfig
@@ -17,6 +17,11 @@ config I2C_MUX_GPIO
This driver can also be built as a module. If so, the module
will be called i2c-mux-gpio.
+config ARCH_NR_GPIOS
+ int "Maximum number of GPIOs (256-2048)"
+ range 256 2048
+ default "256"
+
config I2C_MUX_PCA9541
tristate "NXP PCA9541 I2C Master Selector"
help
@@ -53,6 +58,12 @@ config I2C_MUX_QUANTA_LY2
If you say yes here you get support for the Quanta LY2 I2C/GPIO
multiplexer.
+config I2C_MUX_QUANTA_LY2R
+ tristate "Quanta LY2R I2C multiplexer"
+ help
+ If you say yes here you get support for the Quanta LY2R I2C/GPIO
+ multiplexer.
+
config I2C_MUX_QUANTA_LY5
tristate "Quanta LY5 I2C multiplexer"
help
diff --git a/drivers/i2c/muxes/Makefile b/drivers/i2c/muxes/Makefile
index af05ecab..f7b36791 100644
--- a/drivers/i2c/muxes/Makefile
+++ b/drivers/i2c/muxes/Makefile
@@ -6,6 +6,8 @@ obj-$(CONFIG_I2C_MUX_PCA9541) += i2c-mux-pca9541.o
obj-$(CONFIG_I2C_MUX_PCA954x) += i2c-mux-pca954x.o
obj-$(CONFIG_I2C_MUX_PINCTRL) += i2c-mux-pinctrl.o
obj-$(CONFIG_I2C_MUX_QUANTA_LY2) += quanta-ly2-i2c-mux.o
+obj-$(CONFIG_I2C_MUX_QUANTA_LY2R) += quanta-ly2r-i2c-mux.o
+obj-$(CONFIG_I2C_MUX_QUANTA_LY2R) += quanta-ly2r-i2c-mux-gpio.o
obj-$(CONFIG_I2C_MUX_QUANTA_LY5) += quanta-ly5-i2c-mux.o
ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG
diff --git a/drivers/i2c/muxes/quanta-ly2r-i2c-mux-gpio.c b/drivers/i2c/muxes/quanta-ly2r-i2c-mux-gpio.c
new file mode 100644
index 00000000..eae4794c
--- /dev/null
+++ b/drivers/i2c/muxes/quanta-ly2r-i2c-mux-gpio.c
@@ -0,0 +1,286 @@
+/*
+ *
+ *
+ * Copyright 2013, 2014 BigSwitch Networks, Inc.
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms ofthe GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ *
+ *
+ *
+ * An I2C multiplexer driver for the Quanta LY2R
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*=============================================================================*/
+/* Detecting SFP+ modules exist via PLD device's command 0x01, 0x02, 0x03, and 0x04.
+ * Port bit map is as below:
+ * Byte 0 Byte 1
+ * Bit 0 1 2 3 4 5 6 7 Bit 0 1 2 3 4 5 6 7
+ * Mode O I I I O I I I O I I I O I I I
+*/
+#define QUANTA_LY2R_I2C_MUX_NUM_READ_GPIOS 48
+#define QUANTA_LY2R_I2C_MUX_NUM_WRITE_GPIOS 16
+#define QUANTA_LY2R_I2C_MUX_NUM_GPIO_GROUPS 4
+#define QUANTA_LY2R_I2C_MUX_NUM_GPIOS (QUANTA_LY2R_I2C_MUX_NUM_READ_GPIOS + QUANTA_LY2R_I2C_MUX_NUM_WRITE_GPIOS)
+#define QUANTA_LY2R_I2C_MUX_NUM_GPIO_PINS_PER_GROUP (QUANTA_LY2R_I2C_MUX_NUM_GPIOS / QUANTA_LY2R_I2C_MUX_NUM_GPIO_GROUPS)
+
+struct quanta_ly2r_i2c_mux_gpio {
+ struct i2c_client *client;
+ struct gpio_chip gpio_chip;
+ u16 gpio_write_val;
+};
+
+static const struct i2c_device_id quanta_ly2r_i2c_mux_gpio_id[] = {
+ {"quanta_ly2r_cpld", 0xf2f1},
+ {}
+};
+
+MODULE_DEVICE_TABLE(i2c, quanta_ly2r_i2c_mux_gpio_id);
+
+/*
+ * Read 2 bytes once per command, and command should be group 1~4
+ */
+static int quanta_ly2r_i2c_mux_gpio_reg_read(struct i2c_adapter *adap,
+ struct i2c_client *client,
+ u8 command, u16 *val)
+{
+ int ret = -ENODEV;
+
+ if (adap->algo->master_xfer) {
+ struct i2c_msg msg[2];
+ char buf[4];
+
+ msg[0].addr = client->addr;
+ msg[0].flags = 0;
+ msg[0].len = 1;
+ buf[0] = command;
+ msg[0].buf = &buf[0];
+
+ /* always receive 3 bytes, else the PLD freaks out */
+ msg[1].addr = client->addr;
+ msg[1].flags = I2C_M_RD;
+ msg[1].len = 3;
+ msg[1].buf = &buf[1];
+
+ ret = adap->algo->master_xfer(adap, msg, 2);
+ if (val != NULL && ret > -1)
+ *val = ((buf[2] << 8) | buf[1]);
+ } else {
+ union i2c_smbus_data data;
+ data.block[0] = 3; /* block transfer length */
+ ret = adap->algo->smbus_xfer(adap, client->addr,
+ client->flags,
+ I2C_SMBUS_READ,
+ command,
+ I2C_SMBUS_I2C_BLOCK_DATA, &data);
+ if (val != NULL)
+ *val = ((data.block[2] << 8) | data.block[1]);
+ }
+
+ return ret;
+}
+
+/*
+ * Write 3 bytes once per command, and command should be group 1~4
+ */
+static int quanta_ly2r_i2c_mux_gpio_reg_write(struct i2c_adapter *adap,
+ struct i2c_client *client,
+ u8 command, u16 val)
+{
+ int ret = -ENODEV;
+
+ if (adap->algo->master_xfer) {
+ struct i2c_msg msg;
+ char buf[4];
+
+ msg.addr = client->addr;
+ msg.flags = 0;
+ msg.len = 3;
+ buf[0] = command;
+ buf[1] = (val & 0xff);
+ buf[2] = ((val >> 8) & 0xff);
+ buf[3] = 0;
+ msg.buf = buf;
+ ret = adap->algo->master_xfer(adap, &msg, 1);
+ } else {
+ union i2c_smbus_data data;
+
+ data.block[0] = 3;
+ data.block[1] = (val & 0xff);
+ data.block[2] = ((val >> 8) & 0xff);
+ data.block[3] = 0;
+
+ ret = adap->algo->smbus_xfer(adap, client->addr,
+ client->flags,
+ I2C_SMBUS_WRITE,
+ command,
+ I2C_SMBUS_I2C_BLOCK_DATA, &data);
+ }
+
+ return ret;
+}
+
+static void quanta_ly2r_i2c_mux_gpio_set(struct gpio_chip *gc, unsigned offset,
+ int val)
+{
+ struct quanta_ly2r_i2c_mux_gpio *data = container_of(
+ gc, struct quanta_ly2r_i2c_mux_gpio, gpio_chip);
+ int ret;
+ u32 group;
+
+ /* ignore write attempts to input GPIOs */
+ if ((offset % 4) == 1 || (offset % 4) == 2) {
+ dev_warn(&data->client->dev,
+ "ignoring GPIO write for input for pin %d\n",
+ offset);
+ return;
+ }
+
+ group = (offset / QUANTA_LY2R_I2C_MUX_NUM_GPIO_PINS_PER_GROUP) + 1;
+ ret = quanta_ly2r_i2c_mux_gpio_reg_read(data->client->adapter,
+ data->client,
+ group,
+ &data->gpio_write_val);
+
+ if (ret < 0) {
+ dev_err(&data->client->dev,
+ "quanta_ly2r_i2c_mux_gpio_reg_read failed\n");
+ return;
+ }
+
+ if (val)
+ data->gpio_write_val |= (1 << (offset % QUANTA_LY2R_I2C_MUX_NUM_GPIO_PINS_PER_GROUP));
+ else
+ data->gpio_write_val &= ~(1 << (offset % QUANTA_LY2R_I2C_MUX_NUM_GPIO_PINS_PER_GROUP));
+
+ quanta_ly2r_i2c_mux_gpio_reg_write(
+ data->client->adapter, data->client,
+ group,
+ data->gpio_write_val);
+}
+
+static int quanta_ly2r_i2c_mux_gpio_get(struct gpio_chip *gc, unsigned offset)
+{
+ int ret;
+ u16 buf;
+ u32 group;
+ struct quanta_ly2r_i2c_mux_gpio *data = container_of(
+ gc, struct quanta_ly2r_i2c_mux_gpio, gpio_chip);
+
+ if (offset >= (QUANTA_LY2R_I2C_MUX_NUM_GPIOS)) {
+ offset -= (QUANTA_LY2R_I2C_MUX_NUM_GPIOS);
+ }
+
+ group = (offset / QUANTA_LY2R_I2C_MUX_NUM_GPIO_PINS_PER_GROUP) + 1;
+ buf = 0;
+ ret = quanta_ly2r_i2c_mux_gpio_reg_read(data->client->adapter,
+ data->client,
+ group,
+ &buf);
+
+ if (ret < 0) {
+ dev_err(&data->client->dev,
+ "quanta_ly2r_i2c_mux_gpio_reg_read failed\n");
+ return 0;
+ }
+ return (buf & (1 << (offset % QUANTA_LY2R_I2C_MUX_NUM_GPIO_PINS_PER_GROUP))) ? 1 : 0;
+}
+
+static struct gpio_chip quanta_ly2r_i2c_mux_gpio_chip = {
+ .label = "quanta_ly2r_i2c_mux_gpio_chip",
+ .owner = THIS_MODULE,
+ .ngpio = QUANTA_LY2R_I2C_MUX_NUM_READ_GPIOS + QUANTA_LY2R_I2C_MUX_NUM_WRITE_GPIOS,
+ .base = -1,
+ .set = quanta_ly2r_i2c_mux_gpio_set,
+ .get = quanta_ly2r_i2c_mux_gpio_get,
+};
+
+static int quanta_ly2r_i2c_mux_gpio_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct i2c_adapter *adap = client->adapter;
+ struct quanta_ly2r_i2c_mux_gpio *data;
+ int ret = -ENODEV;
+
+ if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE_DATA))
+ goto err;
+
+ data = kzalloc(sizeof(struct quanta_ly2r_i2c_mux_gpio), GFP_KERNEL);
+ if (!data) {
+ ret = -ENOMEM;
+ goto err;
+ }
+
+ i2c_set_clientdata(client, data);
+ data->client = client;
+
+ if (i2c_smbus_write_byte(client, 0) < 0) {
+ dev_warn(&client->dev, "probe failed\n");
+ goto exit_free;
+ }
+
+ data->gpio_chip = quanta_ly2r_i2c_mux_gpio_chip;
+ data->gpio_chip.dev = &client->dev;
+ data->gpio_write_val = 0xff;
+
+ ret = gpiochip_add(&data->gpio_chip);
+ if (ret) {
+ dev_err(&client->dev, "failed to register GPIOs\n");
+ goto exit_free;
+ }
+
+ dev_info(&client->dev,
+ "registered GPIOs for I2C mux %s (%d read, %d write)\n",
+ client->name,
+ QUANTA_LY2R_I2C_MUX_NUM_READ_GPIOS,
+ QUANTA_LY2R_I2C_MUX_NUM_WRITE_GPIOS);
+
+ return 0;
+
+exit_free:
+ kfree(data);
+err:
+ return ret;
+}
+
+static int quanta_ly2r_i2c_mux_gpio_remove(struct i2c_client *client)
+{
+ struct quanta_ly2r_i2c_mux_gpio *data = i2c_get_clientdata(client);
+ int ret;
+
+ ret = gpiochip_remove(&data->gpio_chip);
+ if (ret)
+ return ret;
+
+ kfree(data);
+ return 0;
+}
+
+static struct i2c_driver quanta_ly2r_i2c_mux_gpio_driver = {
+ .driver = {
+ .name = "quanta_ly2r_i2c_mux_gpio",
+ .owner = THIS_MODULE,
+ },
+ .probe = quanta_ly2r_i2c_mux_gpio_probe,
+ .remove = quanta_ly2r_i2c_mux_gpio_remove,
+ .id_table = quanta_ly2r_i2c_mux_gpio_id,
+};
+
+module_i2c_driver(quanta_ly2r_i2c_mux_gpio_driver);
+
+MODULE_AUTHOR("QCT Technical ");
+MODULE_DESCRIPTION("Quanta LY2R I2C multiplexer gpio driver");
+MODULE_LICENSE("LGPL");
diff --git a/drivers/i2c/muxes/quanta-ly2r-i2c-mux.c b/drivers/i2c/muxes/quanta-ly2r-i2c-mux.c
new file mode 100644
index 00000000..ced340fe
--- /dev/null
+++ b/drivers/i2c/muxes/quanta-ly2r-i2c-mux.c
@@ -0,0 +1,214 @@
+/*
+ *
+ *
+ * Copyright 2013, 2014 BigSwitch Networks, Inc.
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms ofthe GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ *
+ *
+ *
+ * An I2C multiplexer driver for the Quanta LY2R
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define QUANTA_LY2R_I2C_MUX_CHANNEL_FIRST 1
+
+#define QUANTA_LY2R_I2C_MUX_NUM_CHANNELS 32
+
+#define QUANTA_LY2R_I2C_MUX_CMD_SET_CHANNEL 0
+
+struct quanta_ly2r_i2c_mux {
+ struct i2c_client *client;
+ struct i2c_adapter *chan_adap[QUANTA_LY2R_I2C_MUX_NUM_CHANNELS];
+ u8 last_chan;
+};
+
+static const struct i2c_device_id quanta_ly2r_i2c_mux_id[] = {
+ {"quanta_ly2r_i2c_mux", 0xf2f0},
+ {}
+};
+
+MODULE_DEVICE_TABLE(i2c, quanta_ly2r_i2c_mux_id);
+
+/*
+ * pld.c shows 3-byte output transactions;
+ * in our case we need 16 bits to
+ * (1) select one of the 32 muxed i2c devices
+ */
+static int quanta_ly2r_i2c_mux_reg_write(struct i2c_adapter *adap,
+ struct i2c_client *client,
+ u8 command, u8 val)
+{
+ int ret = -ENODEV;
+
+ if (adap->algo->master_xfer) {
+ struct i2c_msg msg;
+ char buf[4];
+
+ msg.addr = client->addr;
+ msg.flags = 0;
+ msg.len = 2;
+ buf[0] = command;
+ buf[1] = val;
+ buf[2] = 0;
+ buf[3] = 0;
+ msg.buf = buf;
+ ret = adap->algo->master_xfer(adap, &msg, 1);
+ } else {
+ union i2c_smbus_data data;
+
+ data.block[0] = 2;
+ data.block[1] = val;
+ data.block[2] = 0;
+ data.block[3] = 0;
+
+ ret = adap->algo->smbus_xfer(adap, client->addr,
+ client->flags,
+ I2C_SMBUS_WRITE,
+ command,
+ I2C_SMBUS_I2C_BLOCK_DATA, &data);
+ }
+
+ return ret;
+}
+
+static int quanta_ly2r_i2c_mux_select_chan(struct i2c_adapter *adap,
+ void *client, u32 chan)
+{
+ struct quanta_ly2r_i2c_mux *data = i2c_get_clientdata(client);
+ int ret = 0;
+ u32 c = QUANTA_LY2R_I2C_MUX_CHANNEL_FIRST + chan;
+
+ if (data->last_chan != c) {
+ ret = quanta_ly2r_i2c_mux_reg_write(
+ adap, client,
+ QUANTA_LY2R_I2C_MUX_CMD_SET_CHANNEL, c);
+ data->last_chan = c;
+ }
+
+ return ret;
+}
+
+static int quanta_ly2r_i2c_mux_release_chan(struct i2c_adapter *adap,
+ void *client, u32 chan)
+{
+ struct quanta_ly2r_i2c_mux *data = i2c_get_clientdata(client);
+ int ret = 0;
+
+ ret = quanta_ly2r_i2c_mux_reg_write(
+ adap, client,
+ QUANTA_LY2R_I2C_MUX_CMD_SET_CHANNEL, 0);
+ data->last_chan = 0;
+
+ return ret;
+}
+
+static int quanta_ly2r_i2c_mux_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct i2c_adapter *adap = client->adapter;
+ int chan;
+ struct quanta_ly2r_i2c_mux *data;
+ int ret = -ENODEV;
+
+ if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE_DATA))
+ goto err;
+
+ data = kzalloc(sizeof(struct quanta_ly2r_i2c_mux), GFP_KERNEL);
+ if (!data) {
+ ret = -ENOMEM;
+ goto err;
+ }
+
+ i2c_set_clientdata(client, data);
+ data->client = client;
+
+ if (i2c_smbus_write_byte(client, 0) < 0) {
+ dev_warn(&client->dev, "probe failed\n");
+ goto exit_free;
+ }
+
+ i2c_lock_adapter(adap);
+ quanta_ly2r_i2c_mux_release_chan(adap, client, 0);
+ i2c_unlock_adapter(adap);
+
+ for (chan = 0; chan < QUANTA_LY2R_I2C_MUX_NUM_CHANNELS; chan++) {
+ data->chan_adap[chan] =
+ i2c_add_mux_adapter(adap, &client->dev, client,
+ 0, chan, 0,
+ quanta_ly2r_i2c_mux_select_chan,
+ quanta_ly2r_i2c_mux_release_chan);
+
+ if (data->chan_adap[chan] == NULL) {
+ ret = -ENODEV;
+ dev_err(&client->dev,
+ "failed to register multiplexed adapter %d\n",
+ chan);
+ goto adap_reg_failed;
+ }
+ }
+
+ dev_info(&client->dev,
+ "registered %d multiplexed buses for I2C mux %s\n",
+ chan, client->name);
+
+ return 0;
+
+adap_reg_failed:
+ for (chan--; chan >= 0; chan--)
+ i2c_del_mux_adapter(data->chan_adap[chan]);
+
+exit_free:
+ kfree(data);
+err:
+ return ret;
+}
+
+static int quanta_ly2r_i2c_mux_remove(struct i2c_client *client)
+{
+ struct quanta_ly2r_i2c_mux *data = i2c_get_clientdata(client);
+ int chan, ret;
+
+ for (chan = 0; chan < QUANTA_LY2R_I2C_MUX_NUM_CHANNELS; chan++)
+ if (data->chan_adap[chan]) {
+ ret = i2c_del_mux_adapter(data->chan_adap[chan]);
+ if (ret)
+ return ret;
+ data->chan_adap[chan] = NULL;
+ }
+
+ if (ret)
+ return ret;
+
+ kfree(data);
+ return 0;
+}
+
+static struct i2c_driver quanta_ly2r_i2c_mux_driver = {
+ .driver = {
+ .name = "quanta_ly2r_i2c_mux",
+ .owner = THIS_MODULE,
+ },
+ .probe = quanta_ly2r_i2c_mux_probe,
+ .remove = quanta_ly2r_i2c_mux_remove,
+ .id_table = quanta_ly2r_i2c_mux_id,
+};
+
+module_i2c_driver(quanta_ly2r_i2c_mux_driver);
+
+MODULE_AUTHOR("QCT Technical ");
+MODULE_DESCRIPTION("Quanta LY2R I2C multiplexer driver");
+MODULE_LICENSE("LGPL");
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index bde64699..47e258a1 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -24,6 +24,10 @@
* actually an estimate of a board-specific value.
*/
+#ifdef CONFIG_ARCH_NR_GPIOS
+#define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIOS
+#endif
+
#ifndef ARCH_NR_GPIOS
#define ARCH_NR_GPIOS 256
#endif