Ver código fonte

qcacld-3.0: Add ipci apis for SOC wake and athdiag

Add PLD layer ipci bus apis for soc wake request,
wake release, athdiag read and athdiag write.

Change-Id: I966b4d47b6967615c11420d0b991ac175bf7c276
CRs-fixed: 2702459
Mohammed Siddiq 5 anos atrás
pai
commit
c09b4e4631
2 arquivos alterados com 71 adições e 2 exclusões
  1. 14 2
      core/pld/src/pld_common.c
  2. 57 0
      core/pld/src/pld_ipci.h

+ 14 - 2
core/pld/src/pld_common.c

@@ -1162,7 +1162,9 @@ int pld_force_wake_request(struct device *dev)
 	case PLD_BUS_TYPE_SNOC:
 	case PLD_BUS_TYPE_SDIO:
 	case PLD_BUS_TYPE_USB:
+		break;
 	case PLD_BUS_TYPE_IPCI:
+		ret = pld_ipci_force_wake_request(dev);
 		break;
 	default:
 		pr_err("Invalid device type %d\n", type);
@@ -1196,7 +1198,9 @@ int pld_is_device_awake(struct device *dev)
 	case PLD_BUS_TYPE_SNOC:
 	case PLD_BUS_TYPE_SDIO:
 	case PLD_BUS_TYPE_USB:
+		break;
 	case PLD_BUS_TYPE_IPCI:
+		ret = pld_ipci_is_device_awake(dev);
 		break;
 	default:
 		pr_err("Invalid device type %d\n", type);
@@ -1229,7 +1233,9 @@ int pld_force_wake_release(struct device *dev)
 	case PLD_BUS_TYPE_SNOC:
 	case PLD_BUS_TYPE_SDIO:
 	case PLD_BUS_TYPE_USB:
+		break;
 	case PLD_BUS_TYPE_IPCI:
+		ret = pld_ipci_force_wake_release(dev);
 		break;
 	default:
 		pr_err("Invalid device type %d\n", type);
@@ -1701,10 +1707,13 @@ int pld_athdiag_read(struct device *dev, uint32_t offset,
 		ret = pld_usb_athdiag_read(dev, offset, memtype,
 					   datalen, output);
 		break;
+	case PLD_BUS_TYPE_IPCI:
+		ret = pld_ipci_athdiag_read(dev, offset, memtype,
+					    datalen, output);
+		break;
 	case PLD_BUS_TYPE_PCIE_FW_SIM:
 	case PLD_BUS_TYPE_IPCI_FW_SIM:
 	case PLD_BUS_TYPE_SNOC_FW_SIM:
-	case PLD_BUS_TYPE_IPCI:
 		break;
 	default:
 		ret = -EINVAL;
@@ -1746,10 +1755,13 @@ int pld_athdiag_write(struct device *dev, uint32_t offset,
 		ret = pld_usb_athdiag_write(dev, offset, memtype,
 					    datalen, input);
 		break;
+	case PLD_BUS_TYPE_IPCI:
+		ret = pld_ipci_athdiag_write(dev, offset, memtype,
+					     datalen, input);
+		break;
 	case PLD_BUS_TYPE_PCIE_FW_SIM:
 	case PLD_BUS_TYPE_IPCI_FW_SIM:
 	case PLD_BUS_TYPE_SNOC_FW_SIM:
-	case PLD_BUS_TYPE_IPCI:
 		break;
 	default:
 		ret = -EINVAL;

+ 57 - 0
core/pld/src/pld_ipci.h

@@ -120,6 +120,35 @@ static inline int pld_ipci_smmu_map(struct device *dev, phys_addr_t paddr,
 	return 0;
 }
 
+static inline int pld_ipci_force_wake_request(struct device *dev)
+{
+	return 0;
+}
+
+static inline int pld_ipci_force_wake_release(struct device *dev)
+{
+	return 0;
+}
+
+static inline int pld_ipci_is_device_awake(struct device *dev)
+{
+	return 0;
+}
+
+static inline int pld_ipci_athdiag_read(struct device *dev, uint32_t offset,
+					uint32_t memtype, uint32_t datalen,
+					uint8_t *output)
+{
+	return 0;
+}
+
+static inline int pld_ipci_athdiag_write(struct device *dev, uint32_t offset,
+					 uint32_t memtype, uint32_t datalen,
+					 uint8_t *input)
+{
+	return 0;
+}
+
 #else
 int pld_ipci_register_driver(void);
 void pld_ipci_unregister_driver(void);
@@ -197,5 +226,33 @@ static inline int pld_ipci_smmu_map(struct device *dev, phys_addr_t paddr,
 	return icnss_smmu_map(dev, paddr, iova_addr, size);
 }
 
+static inline int pld_ipci_force_wake_request(struct device *dev)
+{
+	return icnss_force_wake_request(dev);
+}
+
+static inline int pld_ipci_force_wake_release(struct device *dev)
+{
+	return icnss_force_wake_release(dev);
+}
+
+static inline int pld_ipci_is_device_awake(struct device *dev)
+{
+	return icnss_is_device_awake(dev);
+}
+
+static inline int pld_ipci_athdiag_read(struct device *dev, uint32_t offset,
+					uint32_t memtype, uint32_t datalen,
+					uint8_t *output)
+{
+	return icnss_athdiag_read(dev, offset, memtype, datalen, output);
+}
+
+static inline int pld_ipci_athdiag_write(struct device *dev, uint32_t offset,
+					 uint32_t memtype, uint32_t datalen,
+					 uint8_t *input)
+{
+	return icnss_athdiag_write(dev, offset, memtype, datalen, input);
+}
 #endif
 #endif