Lines Matching refs:i2c

92 /* bit banging i2c */
96 struct radeon_i2c_chan *i2c = device_get_softc(dev);
97 struct radeon_device *rdev = i2c->dev->dev_private;
98 struct radeon_i2c_bus_rec *rec = &i2c->rec;
101 /* RV410 appears to have a bug where the hw i2c in reset
102 * holds the i2c port in a bad state - switch hw i2c away before
164 struct radeon_i2c_chan *i2c = device_get_softc(dev);
165 struct radeon_device *rdev = i2c->dev->dev_private;
166 struct radeon_i2c_bus_rec *rec = &i2c->rec;
181 struct radeon_i2c_chan *i2c = device_get_softc(dev);
182 struct radeon_device *rdev = i2c->dev->dev_private;
183 struct radeon_i2c_bus_rec *rec = &i2c->rec;
196 struct radeon_i2c_chan *i2c = device_get_softc(dev);
197 struct radeon_device *rdev = i2c->dev->dev_private;
198 struct radeon_i2c_bus_rec *rec = &i2c->rec;
210 struct radeon_i2c_chan *i2c = device_get_softc(dev);
211 struct radeon_device *rdev = i2c->dev->dev_private;
212 struct radeon_i2c_bus_rec *rec = &i2c->rec;
223 struct radeon_i2c_chan *i2c = device_get_softc(dev);
224 struct radeon_device *rdev = i2c->dev->dev_private;
225 struct radeon_i2c_bus_rec *rec = &i2c->rec;
244 struct radeon_i2c_chan *i2c;
247 i2c = device_get_softc(dev);
248 device_set_desc(dev, i2c->name);
310 /* hw i2c */
392 DRM_ERROR("i2c: unhandled radeon chip\n");
399 /* hw i2c engine for r1xx-4xx hardware
402 static int r100_hw_i2c_xfer(struct radeon_i2c_chan *i2c,
405 struct radeon_device *rdev = i2c->dev->dev_private;
406 struct radeon_i2c_bus_rec *rec = &i2c->rec;
451 DRM_ERROR("gpio not supported with hw i2c\n");
466 DRM_ERROR("gpio not supported with hw i2c\n");
485 DRM_ERROR("gpio not supported with hw i2c\n");
501 DRM_ERROR("gpio not supported with hw i2c\n");
525 DRM_ERROR("gpio not supported with hw i2c\n");
561 DRM_DEBUG("i2c write error 0x%08x\n", tmp);
593 DRM_DEBUG("i2c read error 0x%08x\n", tmp);
621 DRM_DEBUG("i2c write error 0x%08x\n", tmp);
651 /* hw i2c engine for r5xx hardware
654 static int r500_hw_i2c_xfer(struct radeon_i2c_chan *i2c,
657 struct radeon_device *rdev = i2c->dev->dev_private;
658 struct radeon_i2c_bus_rec *rec = &i2c->rec;
718 DRM_ERROR("failed to get i2c bus\n");
735 DRM_ERROR("gpio not supported with hw i2c\n");
768 DRM_DEBUG("i2c write error 0x%08x\n", tmp);
810 DRM_DEBUG("i2c read error 0x%08x\n", tmp);
853 DRM_DEBUG("i2c write error 0x%08x\n", tmp);
889 struct radeon_i2c_chan *i2c = device_get_softc(dev);
890 struct radeon_device *rdev = i2c->dev->dev_private;
891 struct radeon_i2c_bus_rec *rec = &i2c->rec;
913 ret = r100_hw_i2c_xfer(i2c, msgs, num);
918 /* XXX fill in hw i2c implementation */
927 ret = r100_hw_i2c_xfer(i2c, msgs, num);
929 ret = r500_hw_i2c_xfer(i2c, msgs, num);
935 /* XXX fill in hw i2c implementation */
945 /* XXX fill in hw i2c implementation */
952 /* XXX fill in hw i2c implementation */
955 DRM_ERROR("i2c: unhandled radeon chip\n");
973 struct radeon_i2c_chan *i2c;
976 i2c = device_get_softc(dev);
977 device_set_desc(dev, i2c->name);
1037 struct radeon_i2c_chan *i2c;
1045 i2c = malloc(sizeof(struct radeon_i2c_chan),
1047 if (i2c == NULL)
1056 i2c->rec = *rec;
1057 i2c->dev = dev;
1063 /* set the radeon hw i2c adapter */
1064 snprintf(i2c->name, sizeof(i2c->name),
1065 "Radeon i2c hw bus %s", name);
1068 DRM_ERROR("Failed to create bridge for hw i2c %s\n",
1073 device_set_softc(iicbus_dev, i2c);
1077 DRM_ERROR("Attach failed for bridge for hw i2c %s\n",
1083 i2c->adapter = device_find_child(iicbus_dev, "iicbus", -1);
1084 if (i2c->adapter == NULL) {
1085 DRM_ERROR("hw i2c bridge doesn't have iicbus child\n");
1092 /* hw i2c using atom */
1093 snprintf(i2c->name, sizeof(i2c->name),
1094 "Radeon i2c hw bus %s", name);
1097 DRM_ERROR("Failed to create bridge for hw i2c %s\n",
1102 device_set_softc(iicbus_dev, i2c);
1106 DRM_ERROR("Attach failed for bridge for hw i2c %s\n",
1112 i2c->adapter = device_find_child(iicbus_dev, "iicbus", -1);
1113 if (i2c->adapter == NULL) {
1114 DRM_ERROR("hw i2c bridge doesn't have iicbus child\n");
1122 snprintf(i2c->name, sizeof(i2c->name),
1123 "Radeon i2c bit bus %s", name);
1126 DRM_ERROR("Failed to create bridge for bb i2c %s\n",
1131 device_set_softc(iicbus_dev, i2c);
1135 DRM_ERROR("Attach failed for bridge for bb i2c %s\n",
1143 DRM_ERROR("bb i2c bridge doesn't have iicbb child\n");
1148 i2c->adapter = device_find_child(iicbb_dev, "iicbus", -1);
1149 if (i2c->adapter == NULL) {
1157 i2c->iic_bus = iicbus_dev;
1161 return i2c;
1164 free(i2c, DRM_MEM_DRIVER);
1173 struct radeon_i2c_chan *i2c;
1176 i2c = malloc(sizeof(struct radeon_i2c_chan),
1178 if (i2c == NULL)
1181 i2c->rec = *rec;
1182 i2c->dev = dev;
1183 snprintf(i2c->name, sizeof(i2c->name),
1185 ret = iic_dp_aux_add_bus(dev->dev, i2c->name,
1186 radeon_dp_i2c_aux_ch, i2c, &i2c->iic_bus,
1187 &i2c->adapter);
1189 DRM_INFO("Failed to register i2c %s\n", name);
1193 return i2c;
1195 free(i2c, DRM_MEM_DRIVER);
1200 void radeon_i2c_destroy(struct radeon_i2c_chan *i2c)
1202 if (!i2c)
1204 if (i2c->iic_bus != NULL) {
1208 ret = device_delete_child(i2c->dev->dev, i2c->iic_bus);
1211 i2c->name, ret));
1213 free(i2c, DRM_MEM_DRIVER);
1303 DRM_DEBUG("i2c 0x%02x 0x%02x read failed\n",
1325 DRM_DEBUG("i2c 0x%02x 0x%02x write failed\n",